You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/include/storage/index/generic_key.h, it's mentioned that Function object returns true if lhs < rhs, but the implemented comparator performs 3-way comparison.
/** * Function object returns true if lhs < rhs, used for trees*/classGenericComparator {
public:inlineautooperator()(const GenericKey<KeySize> &lhs, const GenericKey<KeySize> &rhs) const -> int {
uint32_t column_count = key_schema_->GetColumnCount();
for (uint32_t i = 0; i < column_count; i++) {
Value lhs_value = (lhs.ToValue(key_schema_, i));
Value rhs_value = (rhs.ToValue(key_schema_, i));
if (lhs_value.CompareLessThan(rhs_value) == CmpBool::CmpTrue) {
return -1;
}
if (lhs_value.CompareGreaterThan(rhs_value) == CmpBool::CmpTrue) {
return1;
}
}
// equalsreturn0;
}
GenericComparator(const GenericComparator &other) : key_schema_{other.key_schema_} {}
// constructorexplicitGenericComparator(Schema *key_schema) : key_schema_(key_schema) {}
private:
Schema *key_schema_;
};
The text was updated successfully, but these errors were encountered:
In
src/include/storage/index/generic_key.h
, it's mentioned thatFunction object returns true if lhs < rhs
, but the implemented comparator performs 3-way comparison.The text was updated successfully, but these errors were encountered: