Skip to content

Commit 86b25a3

Browse files
committed
Use context.hash instead of context.object_id for cache index, as object_id can be recycled due to garbage collection.
1 parent 30fb242 commit 86b25a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/json/ld/context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ def bnode(value = nil)
17891789
# @return [Hash{String => Hash{String => String}}]
17901790
# @todo May want to include @set along with container to allow selecting terms using @set over those without @set. May require adding some notion of value cardinality to compact_iri
17911791
def inverse_context
1792-
Context.inverse_cache[self.object_id] ||= begin
1792+
Context.inverse_cache[self.hash] ||= begin
17931793
result = {}
17941794
default_language = (self.default_language || '@none').downcase
17951795
term_definitions.keys.sort do |a, b|

0 commit comments

Comments
 (0)