commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [1/3] [math] Replaced use of inefficient keyset with use of entryset.
Date Tue, 03 Nov 2015 12:19:48 GMT
Repository: commons-math
Updated Branches:
  refs/heads/MATH_3_X b6c2d697a -> f0c6d3c0c


Replaced use of inefficient keyset with use of entryset.

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

Branch: refs/heads/MATH_3_X
Commit: 96723996663a595cb1d491b09e0a1707a01dc5f0
Parents: b6c2d69
Author: Luc Maisonobe <luc@apache.org>
Authored: Tue Nov 3 12:12:19 2015 +0100
Committer: Luc Maisonobe <luc@apache.org>
Committed: Tue Nov 3 12:12:19 2015 +0100

----------------------------------------------------------------------
 .../commons/math3/exception/util/ExceptionContext.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/96723996/src/main/java/org/apache/commons/math3/exception/util/ExceptionContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/exception/util/ExceptionContext.java b/src/main/java/org/apache/commons/math3/exception/util/ExceptionContext.java
index a9fd95c..1a78bd3 100644
--- a/src/main/java/org/apache/commons/math3/exception/util/ExceptionContext.java
+++ b/src/main/java/org/apache/commons/math3/exception/util/ExceptionContext.java
@@ -283,12 +283,12 @@ public class ExceptionContext implements Serializable {
     private void serializeContext(ObjectOutputStream out)
         throws IOException {
         // Step 1.
-        final int len = context.keySet().size();
+        final int len = context.size();
         out.writeInt(len);
-        for (String key : context.keySet()) {
+        for (Map.Entry<String, Object> entry : context.entrySet()) {
             // Step 2.
-            out.writeObject(key);
-            final Object value = context.get(key);
+            out.writeObject(entry.getKey());
+            final Object value = entry.getValue();
             if (value instanceof Serializable) {
                 // Step 3a.
                 out.writeObject(value);


Mime
View raw message