fix: Do not attempt to defrag StringSet as a StringMap (#4283)

That'd be a total waste of time and energy, not to mention you'll crash.

Fixes #4167
This commit is contained in:
Shahar Mike 2024-12-10 10:44:52 +02:00 committed by GitHub
parent 44e27efc00
commit 0562796cac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -305,9 +305,9 @@ pair<void*, bool> DefragSet(unsigned encoding, void* ptr, float ratio) {
return DefragIntSet((intset*)ptr, ratio);
}
// StringMap supports re-allocation of it's internal nodes
case kEncodingStrMap2: {
return DefragStrMap2((StringMap*)ptr, ratio);
// Still not implemented
return {ptr, false};
}
default: