Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): Fix typo in CompactObj::operator== #1165

Merged
merged 1 commit into from
Apr 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/core/compact_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -940,19 +940,16 @@ bool CompactObj::operator==(const CompactObj& o) const {
DCHECK(taglen_ != JSON_TAG && o.taglen_ != JSON_TAG) << "cannot use JSON type to check equal";

uint8_t m1 = mask_ & kEncMask;
uint8_t m2 = mask_ & kEncMask;
uint8_t m2 = o.mask_ & kEncMask;
if (m1 != m2)
return false;

if (taglen_ == ROBJ_TAG || o.taglen_ == ROBJ_TAG) {
if (o.taglen_ != taglen_)
return false;
return u_.r_obj.Equal(o.u_.r_obj);
}

if (taglen_ != o.taglen_)
return false;

if (taglen_ == ROBJ_TAG)
return u_.r_obj.Equal(o.u_.r_obj);

if (taglen_ == INT_TAG)
return u_.ival == o.u_.ival;

Expand Down