Skip to content

Commit cc77e6c

Browse files
committed
fixed for loop .. issue replaced with until
1 parent f5d6808 commit cc77e6c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/src/org/commcare/connect/ConnectAppUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ object ConnectAppUtils {
138138
val charSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_!.?"
139139
val secureRandom = SecureRandom()
140140
val password = StringBuilder(passwordLength)
141-
for (i in 0..<passwordLength) {
141+
for (i in 0 until passwordLength) {
142142
password.append(charSet[secureRandom.nextInt(charSet.length)])
143143
}
144144

app/src/org/commcare/connect/ConnectJobHelper.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ object ConnectJobHelper {
8989
val modules = json.getJSONArray(key)
9090
val learningRecords: MutableList<ConnectJobLearningRecord> =
9191
ArrayList(modules.length())
92-
for (i in 0..<modules.length()) {
92+
for (i in 0 until modules.length()) {
9393
val obj = modules[i] as JSONObject
9494
val record = ConnectJobLearningRecord.fromJson(obj, job.jobId)
9595
learningRecords.add(record)
@@ -101,7 +101,7 @@ object ConnectJobHelper {
101101
val assessments = json.getJSONArray(key)
102102
val assessmentRecords: MutableList<ConnectJobAssessmentRecord> =
103103
ArrayList(assessments.length())
104-
for (i in 0..<assessments.length()) {
104+
for (i in 0 until assessments.length()) {
105105
val obj = assessments[i] as JSONObject
106106
val record = ConnectJobAssessmentRecord.fromJson(obj, job.jobId)
107107
assessmentRecords.add(record)
@@ -210,7 +210,7 @@ object ConnectJobHelper {
210210
key = "deliveries"
211211
if (json.has(key)) {
212212
val array = json.getJSONArray(key)
213-
for (i in 0..<array.length()) {
213+
for (i in 0 until array.length()) {
214214
val obj = array[i] as JSONObject
215215
deliveries.add(ConnectJobDeliveryRecord.fromJson(obj, job.jobId))
216216
}
@@ -225,7 +225,7 @@ object ConnectJobHelper {
225225
key = "payments"
226226
if (json.has(key)) {
227227
val array = json.getJSONArray(key)
228-
for (i in 0..<array.length()) {
228+
for (i in 0 until array.length()) {
229229
val obj = array[i] as JSONObject
230230
payments.add(ConnectJobPaymentRecord.fromJson(obj, job.jobId))
231231
}

0 commit comments

Comments
 (0)