Skip to content

Commit 37142ea

Browse files
committed
provides minor cleanups
Signed-off-by: Oleh Dokuka <[email protected]> Signed-off-by: Oleh Dokuka <[email protected]>
1 parent 111a3b8 commit 37142ea

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

rsocket-core/src/main/java/io/rsocket/internal/UnboundedProcessor.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ void drainFused(Subscriber<? super T> a) {
146146
for (; ; ) {
147147

148148
if (cancelled) {
149-
q.clear();
150-
pq.clear();
149+
clear();
151150
actual = null;
152151
return;
153152
}
@@ -204,18 +203,7 @@ public void drain() {
204203
boolean checkTerminated(
205204
boolean d, boolean empty, Subscriber<? super T> a, Queue<T> q, Queue<T> pq) {
206205
if (cancelled) {
207-
while (!q.isEmpty()) {
208-
T t = q.poll();
209-
if (t != null) {
210-
release(t);
211-
}
212-
}
213-
while (!pq.isEmpty()) {
214-
T t = pq.poll();
215-
if (t != null) {
216-
release(t);
217-
}
218-
}
206+
clear();
219207
actual = null;
220208
return true;
221209
}

0 commit comments

Comments
 (0)