@@ -104,24 +104,12 @@ public void updateKeyWithNamedWildcard(String key) {
104
104
namedWildcard = key .substring (key .indexOf ('{' ) + 1 , key .indexOf ('}' ));
105
105
}
106
106
107
- public boolean isWildcard () {
108
- return isWildcard ;
109
- }
110
-
111
- public synchronized void addChild (TrieNode child ) {
112
- addInnerChild (child .key , child );
113
- }
114
-
115
107
private void addInnerChild (String key , TrieNode child ) {
116
108
Map <String , TrieNode > newChildren = new HashMap <>(children );
117
109
newChildren .put (key , child );
118
110
children = unmodifiableMap (newChildren );
119
111
}
120
112
121
- public TrieNode getChild (String key ) {
122
- return children .get (key );
123
- }
124
-
125
113
public synchronized void insert (String [] path , int index , T value ) {
126
114
if (index >= path .length )
127
115
return ;
@@ -302,7 +290,7 @@ public void insert(String path, T value) {
302
290
}
303
291
int index = 0 ;
304
292
// Supports initial delimiter.
305
- if (strings . length > 0 && strings [0 ].isEmpty ()) {
293
+ if (strings [0 ].isEmpty ()) {
306
294
index = 1 ;
307
295
}
308
296
root .insert (strings , index , value );
@@ -327,7 +315,7 @@ public void insertOrUpdate(String path, T value, BiFunction<T, T, T> updater) {
327
315
}
328
316
int index = 0 ;
329
317
// Supports initial delimiter.
330
- if (strings . length > 0 && strings [0 ].isEmpty ()) {
318
+ if (strings [0 ].isEmpty ()) {
331
319
index = 1 ;
332
320
}
333
321
root .insertOrUpdate (strings , index , value , updater );
@@ -352,7 +340,7 @@ public T retrieve(String path, Map<String, String> params, TrieMatchingMode trie
352
340
int index = 0 ;
353
341
354
342
// Supports initial delimiter.
355
- if (strings . length > 0 && strings [0 ].isEmpty ()) {
343
+ if (strings [0 ].isEmpty ()) {
356
344
index = 1 ;
357
345
}
358
346
0 commit comments