Explicitly cast capacity to float in raw_hash_set::load_factor. This avoids implicit integer-to-floating-point conversion warnings when computing the load factor. PiperOrigin-RevId: 1015362445
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index 45a6fa8..8c92b87 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h
@@ -2673,7 +2673,8 @@ size_t bucket_count() const { return common().capacity(); } float load_factor() const { const size_t cap = common().capacity(); - return cap ? static_cast<float>(common().size()) / cap : 0.0f; + return cap ? static_cast<float>(common().size()) / static_cast<float>(cap) + : 0.0f; } float max_load_factor() const { return 1.0f; } void max_load_factor(float) {