Use enhanced for loop

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1588859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Duncan Jones 2014-04-21 08:37:46 +00:00
parent 5d9141e206
commit e288d39ba3
1 changed files with 4 additions and 7 deletions

View File

@ -416,9 +416,7 @@ public class DurationFormatUtils {
long milliseconds, final boolean padWithZeros) {
final StringBuilder buffer = new StringBuilder();
boolean lastOutputSeconds = false;
final int sz = tokens.length;
for (int i = 0; i < sz; i++) {
final Token token = tokens[i];
for (final Token token : tokens) {
final Object value = token.getValue();
final int count = token.getCount();
if (value instanceof StringBuilder) {
@ -572,9 +570,8 @@ public class DurationFormatUtils {
* @return boolean <code>true</code> if contained
*/
static boolean containsTokenWithValue(final Token[] tokens, final Object value) {
final int sz = tokens.length;
for (int i = 0; i < sz; i++) {
if (tokens[i].getValue() == value) {
for (Token token : tokens) {
if (token.getValue() == value) {
return true;
}
}