瀏覽代碼

Update lib/ResourceSet.h

Use suggestion.

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

Xilmi 1 年之前
父節點
當前提交
07afb2d649
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      lib/ResourceSet.h

+ 1 - 2
lib/ResourceSet.h

@@ -159,8 +159,7 @@ public:
 				}
 				else {
 					// 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);
 				}
 			}