groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [5/6] groovy git commit: Unnecessary 'contains' check
Date Wed, 04 Apr 2018 00:20:34 GMT
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 <sunlan@apache.org>
Authored: Wed Apr 4 08:08:06 2018 +0800
Committer: sunlan <sunlan@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);
         }
 


Mime
View raw message