Skip to content
Browse files

* vm_method.c (rb_sweep_method_entry): simplify code to unlink.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 0142366 commit cedfed5e8d6371c66f9f664e0c49f5d051dad033 @nobu nobu committed Mar 24, 2013
Showing with 4 additions and 10 deletions.
  1. +4 −10 vm_method.c
View
14 vm_method.c
@@ -122,26 +122,20 @@ void
rb_sweep_method_entry(void *pvm)
{
rb_vm_t *vm = pvm;
- struct unlinked_method_entry_list_entry *ume = vm->unlinked_method_entry_list, *prev_ume = 0, *curr_ume;
+ struct unlinked_method_entry_list_entry **prev_ume = &vm->unlinked_method_entry_list, *ume = *prev_ume, *curr_ume;
while (ume) {
if (ume->me->mark) {
ume->me->mark = 0;
- prev_ume = ume;
- ume = ume->next;
+ prev_ume = &ume->next;
+ ume = *prev_ume;
}
else {
rb_free_method_entry(ume->me);
- if (prev_ume == 0) {
- vm->unlinked_method_entry_list = ume->next;
- }
- else {
- prev_ume->next = ume->next;
- }
-
curr_ume = ume;
ume = ume->next;
+ *prev_ume = ume;
xfree(curr_ume);
}
}

0 comments on commit cedfed5

Please sign in to comment.
Something went wrong with that request. Please try again.