Skip to content

Commit 0ba4684

Browse files
author
John Shepherd
committed
fix left out components bug
Signed-off-by: John Shepherd <[email protected]>
1 parent 213071e commit 0ba4684

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/EntityComponentManager.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,8 @@ void EntityComponentManager::CalculateComponentThreadLoad() const
945945
// Set the number of threads to spawn to the min of the calculated thread
946946
// count or max threads that the hardware supports
947947
this->dataPtr->numComponentThreads = std::min(numThreads, maxThreads);
948-
int componentsPerThread = numComponents / this->dataPtr->numComponentThreads;
948+
int componentsPerThread = std::ceil(static_cast<double>(numComponents) /
949+
this->dataPtr->numComponentThreads);
949950

950951
// Push back the starting iterator
951952
this->dataPtr->entityComponentIterators.push_back(startIt);

0 commit comments

Comments
 (0)