Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/tscore/HostLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ CharIndex::Insert(string_view match_data, HostBranch *toInsert)
illegalKey.reset(new Table);
}
toInsert->key = match_data;
illegalKey->emplace(match_data, toInsert);
illegalKey->emplace(toInsert->key, toInsert);
} else {
while (true) {
index = asciiToTable[static_cast<unsigned char>(match_data.front())];
Expand Down Expand Up @@ -675,20 +675,20 @@ HostLookup::InsertBranch(HostBranch *insert_in, string_view level_data)
ink_release_assert(0);
break;
case HostBranch::HOST_HASH:
insert_in->next_level._table->emplace(level_data, new_branch);
insert_in->next_level._table->emplace(new_branch->key, new_branch);
break;
case HostBranch::HOST_INDEX:
insert_in->next_level._index->Insert(level_data, new_branch);
insert_in->next_level._index->Insert(new_branch->key, new_branch);
break;
case HostBranch::HOST_ARRAY: {
auto array = insert_in->next_level._array;
if (array->Insert(level_data, new_branch) == false) {
// The array is out of space, time to move to a hash table
auto ha = insert_in->next_level._array;
auto ht = new HostTable;
ht->emplace(level_data, new_branch);
ht->emplace(new_branch->key, new_branch);
for (auto &item : *array) {
ht->emplace(item.match_data, item.branch);
ht->emplace(item.branch->key, item.branch);
}
// Ring out the old, ring in the new
delete ha;
Expand Down