|
25 | 25 | import org.truffleruby.core.cast.ToIntNode;
|
26 | 26 | import org.truffleruby.core.klass.RubyClass;
|
27 | 27 | import org.truffleruby.core.proc.RubyProc;
|
28 |
| -import org.truffleruby.language.Nil; |
29 | 28 | import org.truffleruby.language.RubyContextNode;
|
30 | 29 | import org.truffleruby.language.RubyGuards;
|
31 | 30 | import org.truffleruby.language.RubyNode;
|
@@ -137,24 +136,15 @@ protected RubyLongRange eachLong(RubyLongRange range, RubyProc block) {
|
137 | 136 | return range;
|
138 | 137 | }
|
139 | 138 |
|
140 |
| - private Object eachInternal(VirtualFrame frame, RubyRange range, Object block) { |
| 139 | + @Specialization |
| 140 | + protected Object eachObject(RubyObjectRange range, RubyProc block) { |
141 | 141 | if (eachInternalCall == null) {
|
142 | 142 | CompilerDirectives.transferToInterpreterAndInvalidate();
|
143 | 143 | eachInternalCall = insert(DispatchNode.create());
|
144 | 144 | }
|
145 | 145 |
|
146 | 146 | return eachInternalCall.callWithBlock(range, "each_internal", block);
|
147 | 147 | }
|
148 |
| - |
149 |
| - @Specialization |
150 |
| - protected Object eachObject(VirtualFrame frame, RubyLongRange range, Nil block) { |
151 |
| - return eachInternal(frame, range, block); |
152 |
| - } |
153 |
| - |
154 |
| - @Specialization |
155 |
| - protected Object each(VirtualFrame frame, RubyObjectRange range, Object block) { |
156 |
| - return eachInternal(frame, range, block); |
157 |
| - } |
158 | 148 | }
|
159 | 149 |
|
160 | 150 | @CoreMethod(names = "exclude_end?")
|
|
0 commit comments