Skip to content

Commit 553543d

Browse files
committed
Remove unnecessary _end_loc/_start_loc methods
1 parent 81b44e1 commit 553543d

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

ext/rbs_extension/location.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ static VALUE location_end_pos(VALUE self) {
158158
return INT2FIX(loc->rg.end);
159159
}
160160

161-
// TODO: remove it
162-
static VALUE location_start_loc(VALUE self) {
163-
return Qnil;
164-
}
165-
166-
static VALUE location_end_loc(VALUE self) {
167-
return Qnil;
168-
}
169-
170161
static VALUE location_add_required_child(VALUE self, VALUE name, VALUE start, VALUE end) {
171162
rbs_loc *loc = rbs_check_location(self);
172163

@@ -293,8 +284,6 @@ void rbs__init_location(void) {
293284
rb_define_method(RBS_Location, "buffer", location_buffer, 0);
294285
rb_define_method(RBS_Location, "start_pos", location_start_pos, 0);
295286
rb_define_method(RBS_Location, "end_pos", location_end_pos, 0);
296-
rb_define_private_method(RBS_Location, "_start_loc", location_start_loc, 0);
297-
rb_define_private_method(RBS_Location, "_end_loc", location_end_loc, 0);
298287
rb_define_method(RBS_Location, "_add_required_child", location_add_required_child, 3);
299288
rb_define_method(RBS_Location, "_add_optional_child", location_add_optional_child, 3);
300289
rb_define_method(RBS_Location, "_add_optional_no_child", location_add_optional_no_child, 1);

lib/rbs/location_aux.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,11 @@ def end_column
4949
end
5050

5151
def start_loc
52-
@start_loc ||= begin
53-
_start_loc || buffer.pos_to_loc(start_pos)
54-
end
52+
@start_loc ||= buffer.pos_to_loc(start_pos)
5553
end
5654

5755
def end_loc
58-
@end_loc ||= begin
59-
_end_loc || buffer.pos_to_loc(end_pos)
60-
end
56+
@end_loc ||= buffer.pos_to_loc(end_pos)
6157
end
6258

6359
def range

sig/location.rbs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ module RBS
9999

100100
private
101101

102-
def _start_loc: () -> Buffer::loc?
103-
def _end_loc: () -> Buffer::loc?
104-
105102
def _add_required_child: (RequiredChildKeys name, Integer start_pos, Integer end_pos) -> void
106103
def _add_optional_child: (OptionalChildKeys name, Integer start_pos, Integer end_pos) -> void
107104
def _add_optional_no_child: (OptionalChildKeys name) -> void

0 commit comments

Comments
 (0)