Browse Source

Update lib/ResourceSet.h

Use suggestion.

Co-authored-by: Ivan Savenko <[email protected]>

Xilmi 1 year ago
parent
commit
07afb2d649
1 changed files with 1 additions and 2 deletions
  1. 1 2
      lib/ResourceSet.h

+ 1 - 2
lib/ResourceSet.h

@@ -159,8 +159,7 @@ public:
 				}
 				}
 				else {
 				else {
 					// Calculate the number of times we need to accumulate income to fulfill the need
 					// Calculate the number of times we need to accumulate income to fulfill the need
-					float divisionResult = static_cast<float>(container.at(i)) / static_cast<float>(income[i]);
-					int ceiledResult = static_cast<int>(std::ceil(divisionResult));
+					int ceiledResult = vstd::divideAndCeil(container.at(i), income[i]);
 					ret = std::max(ret, ceiledResult);
 					ret = std::max(ret, ceiledResult);
 				}
 				}
 			}
 			}