Skip to content

Commit c679b93

Browse files
authored
Merge pull request jruby#8417 from enebo/triv_parse
Trivial refactoring for match
2 parents a0650ab + f45430d commit c679b93

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/main/java/org/jruby/ir/builder/IRBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,11 +1734,10 @@ protected Variable buildDefnCheckIfThenPaths(Label undefLabel, Operand defVal) {
17341734
}
17351735

17361736
public Operand buildMatch(Variable result, Operand regexp) {
1737-
Variable tempLastLine = temp();
1738-
addResultInstr(new GetGlobalVariableInstr(tempLastLine, symbol("$_")));
1737+
Variable lastLine = addResultInstr(new GetGlobalVariableInstr(temp(), symbol("$_")));
17391738

17401739
if (result == null) result = temp();
1741-
return addResultInstr(new MatchInstr(scope, result, regexp, tempLastLine));
1740+
return addResultInstr(new MatchInstr(scope, result, regexp, lastLine));
17421741
}
17431742

17441743
protected Operand buildModule(ByteList name, U cpath, U bodyNode, StaticScope scope, int line, int endLine) {

0 commit comments

Comments
 (0)