From 00f840dcd1fc53b3face0d824af0eb9de9d19f08 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 7 Jun 2019 12:12:44 +0900 Subject: Consistently use "!isEmpty()" to detect non-empty list Replace "size() > 0" with "!isEmpty()" where appropriate. In the Status implementation we can drop the check; the subsequent loop will only execute when the list is non-empty anyway. Change-Id: I355aff551a603373e702a9d44304f087b476263c Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/lfs/server/TransferHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit.lfs.server') diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java index 4fea92e111..6c36661c3e 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java @@ -84,7 +84,7 @@ abstract class TransferHandler { @Override Body process() throws IOException { Response.Body body = new Response.Body(); - if (objects.size() > 0) { + if (!objects.isEmpty()) { body.objects = new ArrayList<>(); for (LfsObject o : objects) { addObjectInfo(body, o); @@ -122,7 +122,7 @@ abstract class TransferHandler { @Override Body process() throws IOException { Response.Body body = new Response.Body(); - if (objects.size() > 0) { + if (!objects.isEmpty()) { body.objects = new ArrayList<>(); for (LfsObject o : objects) { addObjectInfo(body, o); -- cgit v1.2.3