fix(DenseSet): Rename Size() to UpperBoundSize() and add SizeSlow() (#2130)

Then use the right version (hopefully) in the right places.

Specifically, this fixes a serialization bug, where we could send
malformed responses when using `UpperBoundSize()` to write array length.
This commit is contained in:
Shahar Mike 2023-11-06 08:52:08 +02:00 committed by GitHub
parent f809fb04bc
commit 7e23c14c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 48 additions and 41 deletions

View file

@ -286,7 +286,7 @@ size_t RobjWrapper::Size() const {
}
case kEncodingStrMap2: {
StringSet* ss = (StringSet*)inner_obj_;
return ss->Size();
return ss->UpperBoundSize();
}
default:
LOG(FATAL) << "Unexpected encoding " << encoding_;
@ -300,7 +300,7 @@ size_t RobjWrapper::Size() const {
case kEncodingStrMap2: {
StringMap* sm = (StringMap*)inner_obj_;
return sm->Size();
return sm->UpperBoundSize();
}
}
default:;