Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* 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...
commit cedfed5e8d6371c66f9f664e0c49f5d051dad033 1 parent 0142366
Nobuyoshi Nakada nobu authored

Showing 1 changed file with 4 additions and 10 deletions. Show diff stats Hide diff stats

  1. +4 10 vm_method.c
14 vm_method.c
@@ -122,26 +122,20 @@ void
122 122 rb_sweep_method_entry(void *pvm)
123 123 {
124 124 rb_vm_t *vm = pvm;
125   - struct unlinked_method_entry_list_entry *ume = vm->unlinked_method_entry_list, *prev_ume = 0, *curr_ume;
  125 + struct unlinked_method_entry_list_entry **prev_ume = &vm->unlinked_method_entry_list, *ume = *prev_ume, *curr_ume;
126 126
127 127 while (ume) {
128 128 if (ume->me->mark) {
129 129 ume->me->mark = 0;
130   - prev_ume = ume;
131   - ume = ume->next;
  130 + prev_ume = &ume->next;
  131 + ume = *prev_ume;
132 132 }
133 133 else {
134 134 rb_free_method_entry(ume->me);
135 135
136   - if (prev_ume == 0) {
137   - vm->unlinked_method_entry_list = ume->next;
138   - }
139   - else {
140   - prev_ume->next = ume->next;
141   - }
142   -
143 136 curr_ume = ume;
144 137 ume = ume->next;
  138 + *prev_ume = ume;
145 139 xfree(curr_ume);
146 140 }
147 141 }

0 comments on commit cedfed5

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