Skip to content

Commit d591413

Browse files
author
Antoine Pelisse
committed
schema: Resolve: only dereference schema when needed
Since we may not need the schema at all to resolve the path (and now we may not even have it), let's not dereference it until necessary.
1 parent ff58d58 commit d591413

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

schema/elements.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (s Schema) FindNamedType(name string) (TypeDef, bool) {
207207
//
208208
// This allows callers to not care about the difference between a (possibly
209209
// inlined) reference and a definition.
210-
func (s Schema) Resolve(tr TypeRef) (Atom, bool) {
210+
func (s *Schema) Resolve(tr TypeRef) (Atom, bool) {
211211
if tr.NamedType != nil {
212212
t, ok := s.FindNamedType(*tr.NamedType)
213213
if !ok {

0 commit comments

Comments
 (0)