Skip to content

Commit 79b8706

Browse files
smasatomame
authored andcommitted
Use splat operator for RBS::Location
1 parent c5be818 commit 79b8706

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/typeprof/code_range.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ def self.from_node(node, encoding = Encoding::UTF_16LE)
6161
pos1 = CodePosition.new(node.start_line, node.start_code_units_column(encoding))
6262
pos2 = CodePosition.new(node.end_line, node.end_code_units_column(encoding))
6363
elsif node.is_a?(RBS::Location)
64-
row, col = node.start_loc
65-
pos1 = CodePosition.new(row, col) # TODO: use SPLAT
66-
row, col = node.end_loc
67-
pos2 = CodePosition.new(row, col)
64+
pos1 = CodePosition.new(*node.start_loc)
65+
pos2 = CodePosition.new(*node.end_loc)
6866
else
6967
p node.class.ancestors
7068
raise "unknown type: #{ node.class }"

0 commit comments

Comments
 (0)