summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/utils/ArrayUtils.java
diff options
context:
space:
mode:
authorTom <tw201207@gmail.com>2016-10-26 21:37:19 +0200
committerTom <tw201207@gmail.com>2016-10-27 16:07:26 +0200
commitde3f435db5256bd5a106462dcfc0a2ccdce95450 (patch)
treec3263399e3ebd8023fdcf088379d608cefe86706 /src/main/java/com/gitblit/utils/ArrayUtils.java
parenta3665a6a8218cb19eef6bbddcbbc317258f616f1 (diff)
downloadgitblit-de3f435db5256bd5a106462dcfc0a2ccdce95450.tar.gz
gitblit-de3f435db5256bd5a106462dcfc0a2ccdce95450.zip
Issue #1076: load commit cache in a background thread
* Make the CommitCache fully thread-safe. It was using a ConcurrentHashMap containing lists, but then handed out these lists. It also did multiple operations on that map that as a whole should be atomic. * Use isEmpty() instead of size() == 0. * Run the loading of the commit cache in a background daemon thread
Diffstat (limited to 'src/main/java/com/gitblit/utils/ArrayUtils.java')
-rw-r--r--src/main/java/com/gitblit/utils/ArrayUtils.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/utils/ArrayUtils.java b/src/main/java/com/gitblit/utils/ArrayUtils.java
index 1402ad5e..b850ccc9 100644
--- a/src/main/java/com/gitblit/utils/ArrayUtils.java
+++ b/src/main/java/com/gitblit/utils/ArrayUtils.java
@@ -42,7 +42,7 @@ public class ArrayUtils {
}
public static boolean isEmpty(Collection<?> collection) {
- return collection == null || collection.size() == 0;
+ return collection == null || collection.isEmpty();
}
public static String toString(Collection<?> collection) {