Skip to content

Commit

Permalink
We are no longer interning strings and Ruby symbol was assuming we are
Browse files Browse the repository at this point in the history
enebo committed May 5, 2017
1 parent c4e7631 commit 13212d5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/src/main/java/org/jruby/RubySymbol.java
Original file line number Diff line number Diff line change
@@ -738,9 +738,10 @@ public RubySymbol fastGetSymbol(String internedName) {

public RubySymbol fastGetSymbol(String internedName, boolean hard) {
RubySymbol symbol = null;
int hash = javaStringHashCode(internedName);

for (SymbolEntry e = getEntryFromTable(symbolTable, internedName.hashCode()); e != null; e = e.next) {
if (isSymbolMatch(internedName, e)) {
for (SymbolEntry e = getEntryFromTable(symbolTable, hash); e != null; e = e.next) {
if (isSymbolMatch(internedName, hash, e)) {
if (hard) e.setHardReference();
symbol = e.symbol.get();
break;
@@ -766,10 +767,6 @@ private static boolean isSymbolMatch(ByteList bytes, int hash, SymbolEntry entry
return hash == entry.hash && bytes.equals(entry.bytes);
}

private static boolean isSymbolMatch(String internedName, SymbolEntry entry) {
return internedName == entry.name;
}

private RubySymbol createSymbol(final String name, final ByteList value, final int hash, boolean hard) {
ReentrantLock lock;
(lock = tableLock).lock();

0 comments on commit 13212d5

Please sign in to comment.