diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-16 22:08:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 22:08:04 +0100 |
commit | 2d57c43d9a7ca2142d04b0196a173ce69334acd4 (patch) | |
tree | d14a6c25ff5b78f315f1db7451d3bcf4281c777e /config | |
parent | a8d1b26a8151d5ca1bab0a4dc79c8d733a3f4875 (diff) | |
parent | aebde18f6bf8165d6e93a6b8041b01c69596931f (diff) |
Merge pull request #21237 from vespa-engine/balder/if-queue-is-empty-no-need-to-check-again
If the queue is empty, avoid an extra poll which will do both an extr…
Diffstat (limited to 'config')
-rw-r--r-- | config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java index a18f1b4b260..90c538ac19b 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java @@ -72,12 +72,12 @@ public class JRTConfigSubscription<T extends ConfigInstance> extends ConfigSubsc JRTClientConfigRequest response = pollQueue(timeoutMillis); // There might be more than one response on the queue, so empty queue by polling with // 0 timeout until queue is empty (returned value is null) - JRTClientConfigRequest temp; - do { + JRTClientConfigRequest temp = response; + while (temp != null) { temp = pollQueue(0); if (temp != null) response = temp; - } while (temp != null); + } return response; } |