| 1091 | } |
| 1092 | |
| 1093 | txBoolean fxDeleteEntry(txMachine* the, txSlot* table, txSlot* list, txSlot* key, txBoolean paired, txBoolean fit) |
| 1094 | { |
| 1095 | txSlot* info = list->next; |
| 1096 | txU4 sum = fxSumEntry(the, key); |
| 1097 | txU4 index = sum & (table->value.table.length - 1); |
| 1098 | txSlot** address = &(table->value.table.address[index]); |
| 1099 | txSlot* entry; |
| 1100 | txSlot* first; |
| 1101 | txSlot* last; |
| 1102 | while ((entry = *address)) { |
| 1103 | if (entry->value.entry.sum == sum) { |
| 1104 | first = entry->value.entry.slot; |
| 1105 | if (fxTestEntry(the, first, key)) { |
| 1106 | *address = entry->next; |
| 1107 | entry->next = C_NULL; |
| 1108 | first->flag = XS_DONT_ENUM_FLAG; |
| 1109 | first->kind = XS_UNDEFINED_KIND; |
| 1110 | if (paired) { |
| 1111 | last = first->next; |
| 1112 | last->flag = XS_DONT_ENUM_FLAG; |
| 1113 | last->kind = XS_UNDEFINED_KIND; |
| 1114 | } |
| 1115 | info->value.integer--; |
| 1116 | if (fit) { |
| 1117 | fxResizeEntries(the, table, list); |
| 1118 | fxPurgeEntries(the, list); |
| 1119 | } |
| 1120 | return 1; |
| 1121 | } |
| 1122 | } |
| 1123 | address = &entry->next; |
| 1124 | } |
| 1125 | return 0; |
| 1126 | } |
| 1127 | |
| 1128 | txSlot* fxGetEntry(txMachine* the, txSlot* table, txSlot* slot) |
| 1129 | { |
no test coverage detected