Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2AF2518B1C for ; Tue, 3 Nov 2015 12:19:54 +0000 (UTC) Received: (qmail 99066 invoked by uid 500); 3 Nov 2015 12:19:49 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 98985 invoked by uid 500); 3 Nov 2015 12:19:48 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 98974 invoked by uid 99); 3 Nov 2015 12:19:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 12:19:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C3DE0DFBA7; Tue, 3 Nov 2015 12:19:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: luc@apache.org To: commits@commons.apache.org Date: Tue, 03 Nov 2015 12:19:48 -0000 Message-Id: <051452b7f2d1481c98f1184d255f00f8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] [math] Replaced use of inefficient keyset with use of entryset. 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 Authored: Tue Nov 3 12:12:19 2015 +0100 Committer: Luc Maisonobe 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 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);