| 138 | } |
| 139 | |
| 140 | void DataWalker::walk_table ( Table * tab, TypeInfo * info ) { |
| 141 | if ( !canVisitTableData(info) ) return; |
| 142 | int keySize = info->firstType->size; |
| 143 | int valueSize = info->secondType->size; |
| 144 | uint64_t count = 0; |
| 145 | for ( uint64_t i=0, is=tab->capacity; i!=is; ++i ) { |
| 146 | if ( tableLiveSlot(*tab, i) ) { |
| 147 | bool last = (count == (tab->size-1)); |
| 148 | // key |
| 149 | char * key = tab->keys + i*keySize; |
| 150 | beforeTableKey(tab, info, key, info->firstType, count, last); |
| 151 | if ( cancel() ) return; |
| 152 | walk ( key, info->firstType ); |
| 153 | if ( cancel() ) return; |
| 154 | afterTableKey(tab, info, key, info->firstType, count, last); |
| 155 | if ( cancel() ) return; |
| 156 | // value |
| 157 | char * value = tab->data + i*valueSize; |
| 158 | beforeTableValue(tab, info, value, info->secondType, count, last); |
| 159 | if ( cancel() ) return; |
| 160 | walk ( value, info->secondType ); |
| 161 | if ( cancel() ) return; |
| 162 | afterTableValue(tab, info, value, info->secondType, count, last); |
| 163 | if ( cancel() ) return; |
| 164 | // next |
| 165 | count ++; |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | void DataWalker::walk ( char * pa, TypeInfo * info ) { |
| 171 | if ( pa == nullptr ) { |
nothing calls this directly
no test coverage detected