diff options
author | vvvv <[email protected]> | 2023-02-03 16:25:30 +0300 |
---|---|---|
committer | vvvv <[email protected]> | 2023-02-03 16:25:30 +0300 |
commit | 954d287a9a6add755a63d6ccfdea112f12189024 (patch) | |
tree | 850972582b9641111ceaff6890803d98f958c451 | |
parent | 2b6e74e1913b394a9f79f090cb39bc778eb71084 (diff) |
fixed overflow
-rw-r--r-- | ydb/library/yql/public/udf/udf_string_ref.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ydb/library/yql/public/udf/udf_string_ref.h b/ydb/library/yql/public/udf/udf_string_ref.h index 3c48fd0c64c..99418bdde73 100644 --- a/ydb/library/yql/public/udf/udf_string_ref.h +++ b/ydb/library/yql/public/udf/udf_string_ref.h @@ -126,12 +126,16 @@ public: return Compare(*this, rhs) >= 0; } + inline constexpr i64 Compare(const TStringRef& rhs) const noexcept { + return Compare(*this, rhs); + } + private: - inline static constexpr int Compare(const TStringRef& s1, const TStringRef& s2) noexcept { + inline static constexpr i64 Compare(const TStringRef& s1, const TStringRef& s2) noexcept { auto minSize = std::min(s1.Size(), s2.Size()); if (const auto result = minSize > 0 ? std::memcmp(s1.Data(), s2.Data(), minSize) : 0) return result; - return int(s1.Size()) - int(s2.Size()); + return i64(s1.Size()) - i64(s2.Size()); } Y_HAS_MEMBER(Data); |