aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-18 14:39:07 -0700
committerGitHub <noreply@github.com>2020-10-18 14:39:07 -0700
commit9e25f74ac2ad8193cc45236403cceea5becb37ff (patch)
treeb1cd4ecc5715817334d5307c5c69d7546e372797 /src
parent0d5dd20257ab5a4c77ff628b67e6d54931d8ae16 (diff)
parent00154ed28944779831563e115186dd7c709eb8ab (diff)
downloadtraccar-server-9e25f74ac2ad8193cc45236403cceea5becb37ff.tar.gz
traccar-server-9e25f74ac2ad8193cc45236403cceea5becb37ff.tar.bz2
traccar-server-9e25f74ac2ad8193cc45236403cceea5becb37ff.zip
Merge pull request #4585 from kamaci/master
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++;