From c5802ed8ef8f5c190a497fc2a3321bc1674168f2 Mon Sep 17 00:00:00 2001 From: eagan Date: Sun, 17 Feb 2013 07:24:28 +0900 Subject: [PATCH] Java5 style 'for' --- src/com/fsck/k9/mail/internet/MimeUtility.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 087a38a85..39d953cb4 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -2312,11 +2312,13 @@ public class MimeUtility { } catch (IllegalCharsetNameException e) { supported = false; } - for (int i = 0, len = CHARSET_FALLBACK_MAP.length; !supported && i < len; i++) { - if (charset.matches(CHARSET_FALLBACK_MAP[i][0])) { + for (String[] rule: CHARSET_FALLBACK_MAP) { + if (supported) + break; + if (charset.matches(rule[0])) { Log.e(K9.LOG_TAG, "I don't know how to deal with the charset " + charset + - ". Falling back to " + CHARSET_FALLBACK_MAP[i][1]); - charset = CHARSET_FALLBACK_MAP[i][1]; + ". Falling back to " + rule[1]); + charset = rule[1]; try { supported = Charset.isSupported(charset); } catch (IllegalCharsetNameException e) {