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

Function das_table_erase

src/misc/daScriptC.cpp:1316–1328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1314}
1315
1316int das_table_erase ( das_context * context, das_table * tab, int key_base_type, const void * key, uint32_t value_size ) {
1317 int erased = 0;
1318 auto * t = (Table *)tab;
1319 DAS_TABLE_DISPATCH(key_base_type, {
1320 KEY_TYPE k;
1321 memcpy(&k, key, sizeof(KEY_TYPE));
1322 uint64_t h = hash_function(*(Context *)context, k);
1323 TableHash<KEY_TYPE> hh((Context *)context, value_size);
1324 int64_t idx = hh.erase(*t, k, h);
1325 if ( idx >= 0 ) erased = 1;
1326 })
1327 return erased;
1328}
1329
1330void das_table_lock ( das_context * context, das_table * tab ) {
1331 table_lock(*(Context *)context, *(Table *)tab, nullptr);

Callers 1

Calls 2

hash_functionFunction · 0.85
eraseMethod · 0.45

Tested by

no test coverage detected