Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a023fd3e377d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bcb4f1d893ee
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 6, 2015

  1. Copy the full SHA
    b7f5673 View commit details
  2. Copy the full SHA
    bcb4f1d View commit details
Original file line number Diff line number Diff line change
@@ -128,8 +128,8 @@ public TranscodingMapNode(TranscodingMapNode prev) {
}

@Specialization
public RubyHash transcodingMap(VirtualFrame frame) {
List<KeyValue> entries = new ArrayList<>();
public Object transcodingMap(VirtualFrame frame) {
final Object ret = newLookupTableNode.call(frame, getContext().getCoreLibrary().getLookupTableClass(), "new", null);

for (CaseInsensitiveBytesHash<TranscoderDB.Entry> sourceEntry : TranscoderDB.transcoders) {
Object key = null;
@@ -148,10 +148,10 @@ public RubyHash transcodingMap(VirtualFrame frame) {
lookupTableWriteNode.call(frame, value, "[]=", null, lookupTableKey, true);
}

entries.add(new KeyValue(key, value));
lookupTableWriteNode.call(frame, ret, "[]=", null, key, value);
}

return HashOperations.verySlowFromEntries(getContext().getCoreLibrary().getHashClass(), entries, true);
return ret;
}
}

9 changes: 8 additions & 1 deletion truffle/src/main/ruby/core/rubinius/api/shims/lookuptable.rb
Original file line number Diff line number Diff line change
@@ -8,5 +8,12 @@

# TODO(CS): isn't this vulnerable to naming conflicts?

class LookupTable < Hash
module Rubinius
class LookupTable < Hash
alias_method :lookup_orig, :[]

def [](key)
lookup_orig(key.to_sym)
end
end
end