Skip to content

Commit be8a38b

Browse files
committed
Remove conditional and leave assertion
1 parent 53f95c0 commit be8a38b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/UndesiredAllocationsTracker.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,8 @@ public void trackUndesiredAllocation(ShardRouting shardRouting) {
114114
* Remove any tracking of the specified allocation (a no-op if the allocation isn't being tracked)
115115
*/
116116
public void removeTracking(ShardRouting shardRouting) {
117-
if (shardRouting.unassigned() == false) {
118-
undesiredAllocations.remove(shardRouting.allocationId().getId());
119-
} else {
120-
assert false : "Shouldn't remove tracking of unassigned shards";
121-
}
117+
assert shardRouting.unassigned() == false : "Shouldn't remove tracking of unassigned shards";
118+
undesiredAllocations.remove(shardRouting.allocationId().getId());
122119
}
123120

124121
/**

0 commit comments

Comments
 (0)