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

Function table_for_each

include/daScript/simulate/runtime_table.h:115–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 // called as fn(const TK & key, const TV & value); TV's size must match the table's value stride.
114 template <typename TK, typename TV, typename Fn>
115 __forceinline void table_for_each ( const Table & tab, Fn && fn ) {
116 auto pk = (const TK *) tab.keys;
117 auto pv = (const TV *) tab.data;
118 for ( uint64_t i=0, n=tab.capacity; i!=n; ++i ) {
119 if ( tableLiveSlot(tab, i) ) fn(pk[i], pv[i]);
120 }
121 }
122
123 // Per-key-type policy for the PACKED (small-table) regime: how a packed slot's hash is compared
124 // on find, stored on insert, moved on swap-remove, and read back for promotion, plus how wide the

Callers

nothing calls this directly

Calls 2

tableLiveSlotFunction · 0.85
fnFunction · 0.85

Tested by

no test coverage detected