summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-10 09:15:21 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-10 09:15:21 +0000
commit25c1fd3b9037d9eb39596bb994eeabed812adada (patch)
treed50105485a5d01efee139d56b3c570561adfff97 /st.c
parent0cc2ffbc1bf135a3b7a8656b9242e87b1ad96d6c (diff)
Reverting all commits from r67479 to r67496 because of CI failures
Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'st.c')
-rw-r--r--st.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/st.c b/st.c
index cecc2ac67f..ed235c674e 100644
--- a/st.c
+++ b/st.c
@@ -1548,7 +1548,7 @@ st_update(st_table *tab, st_data_t key,
different for ST_CHECK and when the current element is removed
during traversing. */
static inline int
-st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_update_callback_func *replace, st_data_t arg,
+st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg,
int check_p)
{
st_index_t bin;
@@ -1572,15 +1572,6 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_update_callback_func
rebuilds_num = tab->rebuilds_num;
hash = curr_entry_ptr->hash;
retval = (*func)(key, curr_entry_ptr->record, arg, 0);
-
- if (retval == ST_REPLACE && replace) {
- st_data_t value;
- value = curr_entry_ptr->record;
- retval = (*replace)(&key, &value, arg, TRUE);
- curr_entry_ptr->key = key;
- curr_entry_ptr->record = value;
- }
-
if (rebuilds_num != tab->rebuilds_num) {
retry:
entries = tab->entries;
@@ -1609,8 +1600,6 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_update_callback_func
curr_entry_ptr = &entries[i];
}
switch (retval) {
- case ST_REPLACE:
- break;
case ST_CONTINUE:
break;
case ST_CHECK:
@@ -1659,15 +1648,9 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_update_callback_func
}
int
-st_foreach_with_replace(st_table *tab, int (*func)(ANYARGS), st_update_callback_func *replace, st_data_t arg)
-{
- return st_general_foreach(tab, func, replace, arg, TRUE);
-}
-
-int
st_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg)
{
- return st_general_foreach(tab, func, NULL, arg, FALSE);
+ return st_general_foreach(tab, func, arg, FALSE);
}
/* See comments for function st_delete_safe. */
@@ -1675,7 +1658,7 @@ int
st_foreach_check(st_table *tab, int (*func)(ANYARGS), st_data_t arg,
st_data_t never ATTRIBUTE_UNUSED)
{
- return st_general_foreach(tab, func, NULL, arg, TRUE);
+ return st_general_foreach(tab, func, arg, TRUE);
}
/* Set up array KEYS by at most SIZE keys of head table TAB entries.