Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hoist assignment into the for loop.

  • Loading branch information...
commit 3920706efacee1f05a44b5a312d4989b4004a472 1 parent ac27e15
@szegedi szegedi authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  st.c
View
3  st.c
@@ -481,14 +481,13 @@ st_foreach_map(table, map_key_func, map_value_func)
int i;
for(i = 0; i < table->num_bins; i++) {
- for(ptr = table->bins[i]; ptr != 0;) {
+ for(ptr = table->bins[i]; ptr != 0; ptr = ptr->next) {
new_key = (*map_key_func)(ptr->key);
if(new_key != ptr->key && table->type->compare(new_key, ptr->key)) {
rb_bug("Key replaced with non-equal key");
}
ptr->key = new_key;
ptr->record = (*map_value_func)(ptr->record);
- ptr = ptr->next;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.