[tor-commits] [metrics-lib/master] Simplify method call.

karsten at torproject.org karsten at torproject.org
Wed Nov 20 11:50:26 UTC 2019


commit 5af3f60993a5ccf68545ca83a485e966a66343a9
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Wed Nov 20 12:07:49 2019 +0100

    Simplify method call.
---
 src/main/java/org/torproject/descriptor/impl/KeyValueMap.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/descriptor/impl/KeyValueMap.java b/src/main/java/org/torproject/descriptor/impl/KeyValueMap.java
index 08ad84e..6cb4680 100644
--- a/src/main/java/org/torproject/descriptor/impl/KeyValueMap.java
+++ b/src/main/java/org/torproject/descriptor/impl/KeyValueMap.java
@@ -20,7 +20,7 @@ public class KeyValueMap<T> extends TreeMap<String, T> {
 
   private void putPair(String key, T value, String line, String listElement,
       int keyLength) throws DescriptorParseException {
-    if (this.keySet().contains(key)) {
+    if (this.containsKey(key)) {
       throw new DescriptorParseException("Line '" + line + "' contains "
           + "duplicate key '" + key + "'.");
     }





More information about the tor-commits mailing list