Skip to content

Commit a447ad5

Browse files
committed
RATIS-1968. Remove unreached else block of trySendDelayed
1 parent 5383153 commit a447ad5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

ratis-common/src/main/java/org/apache/ratis/util/SlidingWindow.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,11 @@ public synchronized void receiveReply(
356356
}
357357

358358
private void trySendDelayed(Consumer<REQUEST> sendMethod) {
359+
// We check "firstReplied" in case receiving unexpected replies.
359360
if (firstReplied) {
360361
// after first received, all other requests can be submitted (out-of-order)
361362
delayedRequests.getAllAndClear().forEach(
362363
seqNum -> sendMethod.accept(requests.getNonRepliedRequest(seqNum, "trySendDelayed")));
363-
} else {
364-
// Otherwise, submit the first only if it is a delayed request
365-
final Iterator<REQUEST> i = requests.iterator();
366-
if (i.hasNext()) {
367-
final REQUEST r = i.next();
368-
final Long delayed = delayedRequests.remove(r.getSeqNum());
369-
if (delayed != null) {
370-
sendOrDelayRequest(r, sendMethod);
371-
}
372-
}
373364
}
374365
}
375366

0 commit comments

Comments
 (0)