Skip to content

Commit 1320e74

Browse files
committed
move the length() to outside of loop
1 parent b0191a6 commit 1320e74

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

CDL.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public static JSONObject rowToJSONObject(JSONArray names, JSONTokener x)
143143
*/
144144
public static String rowToString(JSONArray ja) {
145145
StringBuilder sb = new StringBuilder();
146-
for (int i = 0; i < ja.length(); i += 1) {
146+
int jsonArrayLength = ja.length();
147+
for (int i = 0; i < jsonArrayLength; i += 1) {
147148
if (i > 0) {
148149
sb.append(',');
149150
}

0 commit comments

Comments
 (0)