Skip to content

Commit 0434558

Browse files
committed
Reduce diff
1 parent 0d30b5c commit 0434558

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDeciders.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,19 @@ private Decision withDeciders(
205205
BiFunction<String, Decision, String> logMessageCreator
206206
) {
207207
if (debugMode == RoutingAllocation.DebugMode.OFF) {
208-
Decision worstDecision = Decision.YES;
208+
Decision mostNegativeDecision = Decision.YES;
209209
for (AllocationDecider decider : deciders) {
210-
var newDecision = deciderAction.apply(decider);
211-
if (newDecision.type().isWorseForTheSameNode(worstDecision.type())) {
212-
worstDecision = newDecision;
213-
if (worstDecision.type() == Decision.Type.NO) {
214-
traceNoDecisions(decider, newDecision, logMessageCreator);
210+
var decision = deciderAction.apply(decider);
211+
if (decision.type().isWorseForTheSameNode(mostNegativeDecision.type())) {
212+
mostNegativeDecision = decision;
213+
if (mostNegativeDecision.type() == Decision.Type.NO) {
214+
traceNoDecisions(decider, decision, logMessageCreator);
215215
break;
216216
}
217217
}
218218
}
219219

220-
return worstDecision;
220+
return mostNegativeDecision;
221221
} else {
222222
final var multiDecision = new Decision.Multi();
223223
for (AllocationDecider decider : deciders) {

0 commit comments

Comments
 (0)