Skip to content

Commit

Permalink
Reduce duplicate code for getting variable
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 3, 2023
1 parent 1b4875d commit 989bfe1
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ public GlobalVariable getVariable(String name) {
}

public IRubyObject set(String name, IRubyObject value) {
assert name != null;
assert name.startsWith("$");

GlobalVariable variable = createIfNotDefined(name);
GlobalVariable variable = getVariable(name);
IRubyObject result = variable.getAccessor().setValue(value);
variable.trace(value);
variable.invalidate();
Expand Down

0 comments on commit 989bfe1

Please sign in to comment.