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:20:34 UTC

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

Unnecessary 'contains' check

(cherry picked from commit 9755409)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 7048b565ab5063c11ad9885e9ba6b61f8b0d5ea7
Parents: d9aa011
Author: sunlan <su...@apache.org>
Authored: Wed Apr 4 08:08:06 2018 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Apr 4 08:20:25 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/7048b565/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);
         }