refactor(ingress): 信箱连续上界遍历改用解构
contiguousUpTo 由 row.msgId 改为 for ((msgId, _) in rows);MailboxRow 是 data class, 取值结果相同,行为不变,无配置与迁移影响。 验证:./gradlew test 通过。
This commit is contained in:
@@ -108,9 +108,9 @@ class InboxPoller(
|
|||||||
private fun contiguousUpTo(from: Long, rows: List<MailboxRow>): Long? {
|
private fun contiguousUpTo(from: Long, rows: List<MailboxRow>): Long? {
|
||||||
var expected = from + 1
|
var expected = from + 1
|
||||||
var last: Long? = null
|
var last: Long? = null
|
||||||
for (row in rows) {
|
for ((msgId, _) in rows) {
|
||||||
if (row.msgId != expected) break
|
if (msgId != expected) break
|
||||||
last = row.msgId
|
last = msgId
|
||||||
expected++
|
expected++
|
||||||
}
|
}
|
||||||
return last
|
return last
|
||||||
|
|||||||
Reference in New Issue
Block a user