diff --git a/src/node_buffer.cc b/src/node_buffer.cc index be9324a8bd82ab..215bd8003aabe1 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -220,9 +220,8 @@ inline MUST_USE_RESULT Maybe ParseArrayIndex(Environment* env, return Just(false); // Check that the result fits in a size_t. - const uint64_t kSizeMax = static_cast(static_cast(-1)); // coverity[pointless_expression] - if (static_cast(tmp_i) > kSizeMax) + if (static_cast(tmp_i) > std::numeric_limits::max()) return Just(false); *ret = static_cast(tmp_i);