aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkamaci <furkankamaci@gmail.com>2020-10-19 00:35:24 +0300
committerkamaci <furkankamaci@gmail.com>2020-10-19 00:35:24 +0300
commit00154ed28944779831563e115186dd7c709eb8ab (patch)
treeb1cd4ecc5715817334d5307c5c69d7546e372797 /src
parent3ad889413e4b13d2dd6a2aa6454964dd9427fb28 (diff)
downloadtrackermap-server-00154ed28944779831563e115186dd7c709eb8ab.tar.gz
trackermap-server-00154ed28944779831563e115186dd7c709eb8ab.tar.bz2
trackermap-server-00154ed28944779831563e115186dd7c709eb8ab.zip
Map control on null check is simplified.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/database/QueryBuilder.java6
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++;