Skip to content

Commit 4f920e5

Browse files
committed
simplify unit selection with null coalescing operator
1 parent 34ba68f commit 4f920e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C7/Map/MapView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private MapUnit selectUnitToDisplay(List<MapUnit> units) {
9898
}
9999
}
100100
// Prefer showing the selected unit, secondly show one doing a relevant animation, otherwise show the top defender
101-
return selected is not null ? selected : (interesting is not null ? interesting : bestDefender);
101+
return selected ?? interesting ?? bestDefender;
102102
}
103103

104104
public List<Tile> getVisibleTiles() {

0 commit comments

Comments
 (0)