Skip to content

Commit

Permalink
refactor Schema#each_schema_uri skip unneeded anchor lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed Oct 26, 2021
1 parent 6bec585 commit 5e5b829
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/jsi/schema.rb
Expand Up @@ -288,10 +288,13 @@ def each_schema_uri
resource.is_a?(Schema) && resource.schema_absolute_uri
end

anchored = self.anchor
parent_schemas.each do |parent_schema|
if anchor
if anchored
if parent_schema.jsi_anchor_subschema(anchor) == self
yield parent_schema.schema_absolute_uri.merge(fragment: anchor)
else
anchored = false
end
end

Expand Down

0 comments on commit 5e5b829

Please sign in to comment.