Skip to content

Commit

Permalink
Change a logical || to a bitwise |
Browse files Browse the repository at this point in the history
Silences the following compiler warning. Was previously being called 33 times: 
```
warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
        int max = selectMax || INT_MAX;
                            ^  ~~~~~~~
note: use '|' for a bitwise operation
```
  • Loading branch information
shinra-electric authored Feb 25, 2023
1 parent 52b6bea commit c4d3233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/unit_find.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void SelectFixed(const Vec2i &ltPos, const Vec2i &rbPos, std::vector<CUnit *> &u
Assert(Map.Info.IsPointOnMap(rbPos));
Assert(units.empty());
units.reserve(selectMax << 1);
int max = selectMax || INT_MAX;
int max = selectMax | INT_MAX;

for (Vec2i posIt = ltPos; posIt.y != rbPos.y + 1; ++posIt.y) {
for (posIt.x = ltPos.x; posIt.x != rbPos.x + 1; ++posIt.x) {
Expand Down

0 comments on commit c4d3233

Please sign in to comment.