while内部でtrueを使わない

This commit is contained in:
tateisu 2023-04-23 07:16:27 +09:00
parent f95b9910d1
commit dd46422344
1 changed files with 2 additions and 1 deletions

View File

@ -77,10 +77,11 @@ class NotificationShown(
if (size <= keep * 2) continue
// アカウントごとに3回の削除を一度に行い、残りは次回以降にすませる
var deleteCount = 0
while (deleteCount++ < 3) {
while (size > keep && deleteCount++ < 3) {
// 一度に削除したい数
val step = min(1000, size - keep)
if (step <= 0) break
// 古いものからstep件目の時刻を読む
val time = db.rawQuery(
"select $COL_TIME_CREATE from $table where $COL_ACCT=? order by $COL_TIME_CREATE asc limit ?",