From 00154ed28944779831563e115186dd7c709eb8ab Mon Sep 17 00:00:00 2001 From: kamaci Date: Mon, 19 Oct 2020 00:35:24 +0300 Subject: Map control on null check is simplified. --- src/main/java/org/traccar/database/QueryBuilder.java | 6 +----- 1 file changed, 1 insertion(+), 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 indexList = paramMap.get(name); - if (indexList == null) { - indexList = new LinkedList<>(); - paramMap.put(name, indexList); - } + List indexList = paramMap.computeIfAbsent(name, k -> new LinkedList<>()); indexList.add(index); index++; -- cgit v1.2.3