【修改】合并重读代码

This commit is contained in:
tangzhenye 2022-06-11 14:26:17 +08:00
parent cc4f53d82d
commit e94569b2b2
1 changed files with 1 additions and 5 deletions

View File

@ -621,15 +621,11 @@ void fdb_tsl_iter_by_time(fdb_tsdb_t db, fdb_time_t from, fdb_time_t to, fdb_tsl
do {
read_tsl(db, &tsl);
if (tsl.status != FDB_TSL_UNUSED) {
if (from <= to && tsl.time >= from && tsl.time <= to) {
if ((from <= to && tsl.time >= from && tsl.time <= to) || (from > to && tsl.time <= from && tsl.time >= to)) {
/* iterator is interrupted when callback return true */
if (cb(&tsl, cb_arg)) {
return;
}
} else if (from > to && tsl.time <= from && tsl.time >= to){
if (cb(&tsl, cb_arg)) {
return;
}
} else {
return;
}