Support ID_TABLE_STOP for replace function

Iteration should top if the replace function returns ID_TABLE_STOP.
This commit is contained in:
Peter Zhu 2022-01-25 16:16:37 -05:00
parent 82f0580aa4
commit 142d5db112
Notes: git 2022-01-26 06:51:37 +09:00
1 changed files with 2 additions and 1 deletions

View File

@ -317,7 +317,8 @@ rb_id_table_foreach_values_with_replace(struct rb_id_table *tbl, rb_id_table_for
ret = (*replace)(&val, data, TRUE);
tbl->items[i].val = val;
}
else if (ret == ID_TABLE_STOP)
if (ret == ID_TABLE_STOP)
return;
}
}