Skip to content

Commit f3391af

Browse files
committed
refactor: replace break with continue to remove while warning
1 parent 9033386 commit f3391af

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/src/main/java/to/bitkit/repositories/BlocktankRepo.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class BlocktankRepo @Inject constructor(
305305
if (order == null) {
306306
error = Exception("Order not found '$orderId'")
307307
Logger.error("Order not found '$orderId'", context = TAG)
308-
break
308+
continue
309309
}
310310

311311
val step = updateOrder(order)
@@ -315,25 +315,24 @@ class BlocktankRepo @Inject constructor(
315315
if (order.state2 == BtOrderState2.EXPIRED) {
316316
error = Exception("Order expired '$orderId'")
317317
Logger.error("Order expired '$orderId'", context = TAG)
318-
break
318+
continue
319319
}
320320
if (step > 2) {
321321
Logger.debug(
322322
"Order settled, stopping watch order '$orderId'",
323323
context = TAG
324324
)
325325
isSettled = true
326-
break
326+
continue
327327
}
328328
} catch (e: Throwable) {
329329
Logger.error("Failed to watch order '$orderId'", e, context = TAG)
330330
error = e
331-
break
331+
continue
332332
}
333333
delay(frequencyMs)
334334
}
335335
Logger.debug("Stopped watching order '$orderId'", context = TAG)
336-
337336
}
338337

339338
private suspend fun updateOrder(order: IBtOrder): Int {

0 commit comments

Comments
 (0)