MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxFindName

Function fxFindName

xs/sources/xsSymbol.c:290–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290txID fxFindName(txMachine* the, txString theString)
291{
292 txU1* aString;
293 txU4 aSum;
294 txU4 aModulo;
295 txSlot* result;
296
297 aString = (txU1*)theString;
298 aSum = 0;
299 while (*aString != 0) {
300 aSum = (aSum << 1) + *aString++;
301 }
302 aSum &= 0x7FFFFFFF;
303 aModulo = aSum % the->nameModulo;
304 result = the->nameTable[aModulo];
305 while (result != C_NULL) {
306 if (result->value.key.sum == aSum)
307 if (c_strcmp(result->value.key.string, theString) == 0)
308 return mxGetKeySlotID(result);
309 result = result->next;
310 }
311 return 0;
312}
313
314txBoolean fxIsKeyName(txMachine* the, txID theID)
315{

Callers 9

fxFindIDFunction · 0.85
fxIsIDFunction · 0.85
fxPushSubstitutionStringFunction · 0.85
fxClearBreakpointFunction · 0.85
fxParseJSONObjectFunction · 0.85
fxFrameToProfilerRecordFunction · 0.85
fxAbortFunction · 0.85
fxAbortFunction · 0.85
fxAbortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected