Browse Source

YT-22350: Optimize conditional discount and disk quota storage
aa0dd98e9a2e4c54f4e65bd37eb75541ce8fa219

eshcherbin 6 months ago
parent
commit
fe53be6d8e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      yt/yt/core/misc/collection_helpers-inl.h

+ 2 - 2
yt/yt/core/misc/collection_helpers-inl.h

@@ -319,7 +319,7 @@ std::vector<std::pair<typename T::key_type, typename T::mapped_type>> SortHashMa
 template <class T>
 void EnsureVectorSize(std::vector<T>& vector, ssize_t size, const T& defaultValue)
 {
-    if (static_cast<ssize_t>(vector.size()) < size) {
+    if (std::ssize(vector) < size) {
         vector.resize(size, defaultValue);
     }
 }
@@ -347,7 +347,7 @@ void AssignVectorAt(std::vector<T>& vector, ssize_t index, T&& value, const T& d
 template <class T>
 const T& VectorAtOr(const std::vector<T>& vector, ssize_t index, const T& defaultValue)
 {
-    return index < static_cast<ssize_t>(vector.size()) ? vector[index] : defaultValue;
+    return index < std::ssize(vector) ? vector[index] : defaultValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////