aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruzhas <uzhas@ydb.tech>2023-11-03 16:34:14 +0300
committeruzhas <uzhas@ydb.tech>2023-11-03 16:55:31 +0300
commit3035222b78898af94cac7fe967a03a41af9635f6 (patch)
treee4c289dc184b562eb2fad94a6b6d343b83223553
parentda7294a6974480a51914354b9f5977f0067adbc8 (diff)
downloadydb-3035222b78898af94cac7fe967a03a41af9635f6.tar.gz
fix coverity issue Unsigned compared against 0
-rw-r--r--ydb/public/lib/json_value/ydb_json_value.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ydb/public/lib/json_value/ydb_json_value.cpp b/ydb/public/lib/json_value/ydb_json_value.cpp
index d7f15c7a0b..bd64cdfae6 100644
--- a/ydb/public/lib/json_value/ydb_json_value.cpp
+++ b/ydb/public/lib/json_value/ydb_json_value.cpp
@@ -441,7 +441,7 @@ namespace {
{
EnsureType(jsonValue, NJson::JSON_UINTEGER);
unsigned long long intValue = jsonValue.GetUInteger();
- if (intValue > std::numeric_limits<ui8>::max() || intValue < std::numeric_limits<ui8>::min()) {
+ if (intValue > std::numeric_limits<ui8>::max()) {
ThrowFatalError(TStringBuilder() << "Value \"" << intValue << "\" doesn't fit in UInt8 type");
}
ValueBuilder.Uint8(intValue);
@@ -461,7 +461,7 @@ namespace {
{
EnsureType(jsonValue, NJson::JSON_UINTEGER);
unsigned long long intValue = jsonValue.GetUInteger();
- if (intValue > std::numeric_limits<ui16>::max() || intValue < std::numeric_limits<ui16>::min()) {
+ if (intValue > std::numeric_limits<ui16>::max()) {
ThrowFatalError(TStringBuilder() << "Value \"" << intValue << "\" doesn't fit in UInt16 type");
}
ValueBuilder.Uint16(intValue);
@@ -481,7 +481,7 @@ namespace {
{
EnsureType(jsonValue, NJson::JSON_UINTEGER);
unsigned long long intValue = jsonValue.GetUInteger();
- if (intValue > std::numeric_limits<ui32>::max() || intValue < std::numeric_limits<ui32>::min()) {
+ if (intValue > std::numeric_limits<ui32>::max()) {
ThrowFatalError(TStringBuilder() << "Value \"" << intValue << "\" doesn't fit in UInt32 type");
}
ValueBuilder.Uint32(intValue);
@@ -501,7 +501,7 @@ namespace {
{
EnsureType(jsonValue, NJson::JSON_UINTEGER);
unsigned long long intValue = jsonValue.GetUInteger();
- if (intValue > std::numeric_limits<ui64>::max() || intValue < std::numeric_limits<ui64>::min()) {
+ if (intValue > std::numeric_limits<ui64>::max()) {
ThrowFatalError(TStringBuilder() << "Value \"" << intValue << "\" doesn't fit in UInt64 type");
}
ValueBuilder.Uint64(intValue);