From 64371f74103f4b4472dd5edd7f8b59806b6a7c9b Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Thu, 27 Aug 2015 15:26:32 +0000 Subject: [PATCH] Statement unnecessarily nested within else clause. git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1698184 13f79535-47bb-0310-9956-ffa450edef68 --- .../memcached/MemcachedHttpCacheStorage.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java index cbee5b110..ecf7b00c0 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java @@ -253,15 +253,14 @@ public class MemcachedHttpCacheStorage implements HttpCacheStorage { putEntry(url, updatedEntry); return; + } + final byte[] updatedBytes = serializeEntry(url, updatedEntry); + final CASResponse casResult = client.cas(key, v.getCas(), + updatedBytes); + if (casResult != CASResponse.OK) { + numRetries++; } else { - final byte[] updatedBytes = serializeEntry(url, updatedEntry); - final CASResponse casResult = client.cas(key, v.getCas(), - updatedBytes); - if (casResult != CASResponse.OK) { - numRetries++; - } else { - return; - } + return; } } catch (final OperationTimeoutException ex) { throw new MemcachedOperationTimeoutException(ex);