Skip to content

Commit d8d56b1

Browse files
committed
refactor: Improve efficiency
1 parent c55e64c commit d8d56b1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,9 @@ void PartitionData::doCircleFill(
18601860

18611861
#if RETAIL_COMPATIBLE_CRC
18621862
// Cell coverage diverges at radii >= 240 between algorithms.
1863-
for (Int x = 0; (cellRadius < 240) ? (x <= y) : (x < cellRadius); ++x)
1863+
Int end = cellRadius - 1;
1864+
Int& endRef = (cellRadius < 240) ? y : end;
1865+
for (Int x = 0; x <= endRef; ++x)
18641866
#else
18651867
for (Int x = 0; x <= y; ++x)
18661868
#endif

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,9 @@ void PartitionData::doCircleFill(
18641864

18651865
#if RETAIL_COMPATIBLE_CRC
18661866
// Cell coverage diverges at radii >= 240 between algorithms.
1867-
for (Int x = 0; (cellRadius < 240) ? (x <= y) : (x < cellRadius); ++x)
1867+
Int end = cellRadius - 1;
1868+
Int& endRef = (cellRadius < 240) ? y : end;
1869+
for (Int x = 0; x <= endRef; ++x)
18681870
#else
18691871
for (Int x = 0; x <= y; ++x)
18701872
#endif

0 commit comments

Comments
 (0)