ruby-changes:71014
From: Peter <ko1@a...>
Date: Wed, 26 Jan 2022 06:51:34 +0900 (JST)
Subject: [ruby-changes:71014] 142d5db112 (master): Support ID_TABLE_STOP for replace function
https://git.ruby-lang.org/ruby.git/commit/?id=142d5db112 From 142d5db1122cf28f1a5563c421f169923a9f2e79 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Tue, 25 Jan 2022 16:16:37 -0500 Subject: Support ID_TABLE_STOP for replace function Iteration should top if the replace function returns ID_TABLE_STOP. --- id_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/id_table.c b/id_table.c index 6cf4af9c5fa..a1b09ba0edd 100644 --- a/id_table.c +++ b/id_table.c @@ -317,7 +317,8 @@ rb_id_table_foreach_values_with_replace(struct rb_id_table *tbl, rb_id_table_for https://github.com/ruby/ruby/blob/trunk/id_table.c#L317 ret = (*replace)(&val, data, TRUE); tbl->items[i].val = val; } - else if (ret == ID_TABLE_STOP) + + if (ret == ID_TABLE_STOP) return; } } -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/