]> source.dussan.org Git - jgit.git/commitdiff
TransportHttp: Check for non-empty list with "!isEmpty()" rather than "size() > 0" 81/143481/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 7 Jun 2019 01:59:46 +0000 (10:59 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 7 Jun 2019 01:59:46 +0000 (10:59 +0900)
Change-Id: Iabb627c8f584346eb8ace3c24afb63b4d1ad3d47
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

index 88349a7ee55be5290b08f9cf67b43a1ddcb4eb88..27ab8795154feaa83b556e61e86d56108b9f42fc 100644 (file)
@@ -641,7 +641,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
                                foundCookies.addAll(
                                                extractCookies(HDR_SET_COOKIE2, cookieHeaderValues));
                        }
-                       if (foundCookies.size() > 0) {
+                       if (!foundCookies.isEmpty()) {
                                try {
                                        // update cookie lists with the newly received cookies!
                                        Set<HttpCookie> cookies = cookieFile.getCookies(false);
@@ -929,7 +929,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
                        conn.setReadTimeout(effTimeOut);
                }
                // set cookie header if necessary
-               if (relevantCookies.size() > 0) {
+               if (!relevantCookies.isEmpty()) {
                        setCookieHeader(conn);
                }