0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.0523: loops are repeated

Problem:    Loops are repeated.
Solution:   Use FOR_ALL_ macros. (Yegappan Lakshmanan, closes #5882)
This commit is contained in:
Bram Moolenaar
2020-04-06 22:13:01 +02:00
parent ee4e0c1e9a
commit 00d253e2b2
19 changed files with 72 additions and 44 deletions

View File

@@ -21,6 +21,9 @@
static char tz_cache[64];
#endif
#define FOR_ALL_TIMERS(t) \
for ((t) = first_timer; (t) != NULL; (t) = (t)->tr_next)
/*
* Call either localtime(3) or localtime_r(3) from POSIX libc time.h, with the
* latter version preferred for reentrancy.
@@ -583,7 +586,7 @@ find_timer(long id)
if (id >= 0)
{
for (timer = first_timer; timer != NULL; timer = timer->tr_next)
FOR_ALL_TIMERS(timer)
if (timer->tr_id == id)
return timer;
}
@@ -659,7 +662,7 @@ add_timer_info_all(typval_T *rettv)
{
timer_T *timer;
for (timer = first_timer; timer != NULL; timer = timer->tr_next)
FOR_ALL_TIMERS(timer)
if (timer->tr_id != -1)
add_timer_info(rettv, timer);
}