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 8, 2023
1 parent 2a82b6d commit 244dd9a
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 244dd9a

Please sign in to comment.