mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
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:
parent
f809fb04bc
commit
7e23c14c35
12 changed files with 48 additions and 41 deletions
|
@ -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:;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue