diff options
author | kamaci <furkankamaci@gmail.com> | 2020-10-19 00:35:24 +0300 |
---|---|---|
committer | kamaci <furkankamaci@gmail.com> | 2020-10-19 00:35:24 +0300 |
commit | 00154ed28944779831563e115186dd7c709eb8ab (patch) | |
tree | b1cd4ecc5715817334d5307c5c69d7546e372797 /src/main/java/org | |
parent | 3ad889413e4b13d2dd6a2aa6454964dd9427fb28 (diff) | |
download | trackermap-server-00154ed28944779831563e115186dd7c709eb8ab.tar.gz trackermap-server-00154ed28944779831563e115186dd7c709eb8ab.tar.bz2 trackermap-server-00154ed28944779831563e115186dd7c709eb8ab.zip |
Map control on null check is simplified.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/database/QueryBuilder.java | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/database/QueryBuilder.java b/src/main/java/org/traccar/database/QueryBuilder.java index f57f27e88..084d2940b 100644 --- a/src/main/java/org/traccar/database/QueryBuilder.java +++ b/src/main/java/org/traccar/database/QueryBuilder.java @@ -114,11 +114,7 @@ public final class QueryBuilder { name = name.toLowerCase(); // Add to list - List<Integer> indexList = paramMap.get(name); - if (indexList == null) { - indexList = new LinkedList<>(); - paramMap.put(name, indexList); - } + List<Integer> indexList = paramMap.computeIfAbsent(name, k -> new LinkedList<>()); indexList.add(index); index++; |