【修改】合并重读代码
This commit is contained in:
parent
cc4f53d82d
commit
e94569b2b2
|
@ -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 {
|
do {
|
||||||
read_tsl(db, &tsl);
|
read_tsl(db, &tsl);
|
||||||
if (tsl.status != FDB_TSL_UNUSED) {
|
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 */
|
/* iterator is interrupted when callback return true */
|
||||||
if (cb(&tsl, cb_arg)) {
|
if (cb(&tsl, cb_arg)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (from > to && tsl.time <= from && tsl.time >= to){
|
|
||||||
if (cb(&tsl, cb_arg)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue