| 70 | |
| 71 | |
| 72 | static void tablerehash (TString **vect, int osize, int nsize) { |
| 73 | int i; |
| 74 | for (i = osize; i < nsize; i++) /* clear new elements */ |
| 75 | vect[i] = NULL; |
| 76 | for (i = 0; i < osize; i++) { /* rehash old part of the array */ |
| 77 | TString *p = vect[i]; |
| 78 | vect[i] = NULL; |
| 79 | while (p) { /* for each string in the list */ |
| 80 | TString *hnext = p->u.hnext; /* save next */ |
| 81 | unsigned int h = lmod(p->hash, nsize); /* new position */ |
| 82 | p->u.hnext = vect[h]; /* chain it into array */ |
| 83 | vect[h] = p; |
| 84 | p = hnext; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | |
| 90 | /* |
no outgoing calls
no test coverage detected