You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2018/04/04 00:12:08 UTC

[6/7] groovy git commit: Unnecessary 'contains' check

Unnecessary 'contains' check


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/97554095
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/97554095
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/97554095

Branch: refs/heads/master
Commit: 97554095dc1883afeda0b69ff85f68e8cb6733ff
Parents: 6d0e2f6
Author: sunlan <su...@apache.org>
Authored: Wed Apr 4 08:08:06 2018 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Apr 4 08:08:06 2018 +0800

----------------------------------------------------------------------
 .../groovy-json/src/main/java/groovy/json/JsonGenerator.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/97554095/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
index f6b27f1..be61d67 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
@@ -255,9 +255,7 @@ public interface JsonGenerator {
                                         Closure<?> closure)
         {
             Converter converter = new DefaultJsonGenerator.ClosureConverter(type, closure);
-            if (converters.contains(converter)) {
-                converters.remove(converter);
-            }
+            converters.remove(converter);
             return addConverter(converter);
         }