瀏覽代碼

dense_hash_[map/set]: cleanup

Michele Caini 4 年之前
父節點
當前提交
87ef713a17
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/entt/container/dense_hash_map.hpp
  2. 1 1
      src/entt/container/dense_hash_set.hpp

+ 1 - 1
src/entt/container/dense_hash_map.hpp

@@ -909,7 +909,7 @@ public:
      */
     void rehash(const size_type count) {
         auto value = (std::max)(count, minimum_capacity);
-        value = (std::max)(value, static_cast<size_type>(size() / max_load_factor()));
+        value = std::max<size_type>(value, size() / max_load_factor());
 
         if(const auto sz = next_power_of_two(value); sz != bucket_count()) {
             sparse.first().resize(sz);

+ 1 - 1
src/entt/container/dense_hash_set.hpp

@@ -799,7 +799,7 @@ public:
      */
     void rehash(const size_type count) {
         auto value = (std::max)(count, minimum_capacity);
-        value = (std::max)(value, static_cast<size_type>(size() / max_load_factor()));
+        value = std::max<size_type>(value, size() / max_load_factor());
 
         if(const auto sz = next_power_of_two(value); sz != bucket_count()) {
             sparse.first().resize(sz);