aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server/src/org
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-06-07 12:12:44 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-06-07 12:12:44 +0900
commit00f840dcd1fc53b3face0d824af0eb9de9d19f08 (patch)
treeee529c0fc77b9151107747d19506be00f75bded1 /org.eclipse.jgit.lfs.server/src/org
parentb5a1b770a05848983688b81b5318f6ce15ead68d (diff)
downloadjgit-00f840dcd1fc53b3face0d824af0eb9de9d19f08.tar.gz
jgit-00f840dcd1fc53b3face0d824af0eb9de9d19f08.zip
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 <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src/org')
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java4
1 files changed, 2 insertions, 2 deletions
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);