From 0412b85b08a3b55ddd3e5ead9727aa9ea42f3f22 Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Sun, 1 Oct 2023 17:24:20 -0400 Subject: [PATCH] Static cast to `float` after division. --- parallel_hashmap/phmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index c9dd221..5c94ad5 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -1806,7 +1806,7 @@ class raw_hash_set size_t bucket_count() const { return capacity_; } float load_factor() const { - return capacity_ ? static_cast(size()) / capacity_ : 0.0f; + return capacity_ ? static_cast(static_cast(size()) / capacity_) : 0.0f; } float max_load_factor() const { return 1.0f; } void max_load_factor(float) {