MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / idxHashFind

Function idxHashFind

modules/dasSQLITE/sqlite/shell.c:10467–10479  ·  view source on GitHub ↗

** If zKey/nKey is present in the hash table, return a pointer to the ** hash-entry object. */

Source from the content-addressed store, hash-verified

10465** hash-entry object.
10466*/
10467static IdxHashEntry *idxHashFind(IdxHash *pHash, const char *zKey, int nKey){
10468 int iHash;
10469 IdxHashEntry *pEntry;
10470 if( nKey<0 ) nKey = STRLEN(zKey);
10471 iHash = idxHashString(zKey, nKey);
10472 assert( iHash>=0 );
10473 for(pEntry=pHash->aHash[iHash]; pEntry; pEntry=pEntry->pHashNext){
10474 if( STRLEN(pEntry->zKey)==nKey && 0==memcmp(pEntry->zKey, zKey, nKey) ){
10475 return pEntry;
10476 }
10477 }
10478 return 0;
10479}
10480
10481/*
10482** If the hash table contains an entry with a key equal to the string

Callers 2

idxHashSearchFunction · 0.85
idxPopulateOneStat1Function · 0.85

Calls 2

idxHashStringFunction · 0.85
assertFunction · 0.85

Tested by

no test coverage detected