Skip to content

Commit 0bdd53a

Browse files
committed
refactor: simplify friend priority comparison by removing object ID tie-breaker
1 parent ae7b768 commit 0bdd53a

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,9 +2557,7 @@ inline Bool isLowerPriority(const UpdateModulePtr a, const UpdateModulePtr b)
25572557
DEBUG_ASSERTCRASH(a && b, ("these may no longer be null"));
25582558
UnsignedInt f1 = a->friend_getPriority();
25592559
UnsignedInt f2 = b->friend_getPriority();
2560-
if (f1 != f2)
2561-
return f1 > f2;
2562-
return a->friend_getObject()->getID() > b->friend_getObject()->getID();
2560+
return f1 > f2;
25632561
}
25642562

25652563
// ------------------------------------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,9 +3154,7 @@ inline Bool isLowerPriority(const UpdateModulePtr a, const UpdateModulePtr b)
31543154
DEBUG_ASSERTCRASH(a && b, ("these may no longer be null"));
31553155
UnsignedInt f1 = a->friend_getPriority();
31563156
UnsignedInt f2 = b->friend_getPriority();
3157-
if (f1 != f2)
3158-
return f1 > f2;
3159-
return a->friend_getObject()->getID() > b->friend_getObject()->getID();
3157+
return f1 > f2;
31603158
}
31613159

31623160
// ------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)