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 dc6a5ad commit 00131e9
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,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 00131e9

Please sign in to comment.