Skip to content

Commit

Permalink
Set FSTRING flag on deduplicated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 30, 2024
1 parent 31807bc commit d8f1d82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/ObjectFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public interface ObjectFlags {

int CR_7BIT_F = registry.newFlag(RubyString.class);
int CR_VALID_F = registry.newFlag(RubyString.class);
int FSTRING = registry.newFlag(RubyString.class);

int MATCH_BUSY = registry.newFlag(RubyMatchData.class);

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
Expand Up @@ -4874,6 +4874,7 @@ public RubyString freezeAndDedupString(RubyString string) {

// Never use incoming value as key
deduped = string.strDup(this);
deduped.setFlag(ObjectFlags.FSTRING, true);
deduped.setFrozen(true);

final WeakReference<RubyString> weakref = new WeakReference<>(deduped);
Expand Down

0 comments on commit d8f1d82

Please sign in to comment.