MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / tablerehash

Function tablerehash

third-party/lua-5.5.0/src/lstring.c:72–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71
72static 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/*

Callers 2

luaS_resizeFunction · 0.70
luaS_initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected