MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / tablerehash

Function tablerehash

lib/lua/src/lstring.c:62–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62static void tablerehash (TString **vect, int osize, int nsize) {
63 int i;
64 for (i = osize; i < nsize; i++) /* clear new elements */
65 vect[i] = NULL;
66 for (i = 0; i < osize; i++) { /* rehash old part of the array */
67 TString *p = vect[i];
68 vect[i] = NULL;
69 while (p) { /* for each string in the list */
70 TString *hnext = p->u.hnext; /* save next */
71 unsigned int h = lmod(p->hash, nsize); /* new position */
72 p->u.hnext = vect[h]; /* chain it into array */
73 vect[h] = p;
74 p = hnext;
75 }
76 }
77}
78
79
80/*

Callers 2

luaS_resizeFunction · 0.85
luaS_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected