Skip to content

Commit

Permalink
Do not recursively scan types for which custom serializers have been …
Browse files Browse the repository at this point in the history
…registered
  • Loading branch information
chriso committed Nov 9, 2023
1 parent fd4b63a commit c0a8c25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ func scan(s *Serializer, t reflect.Type, p unsafe.Pointer) {
return
}

// Don't scan types where custom serialization routines
// have been registered.
if _, ok := types.serdeOf(t); ok {
return
}

r := reflect.NewAt(t, p)
if _, ok := s.scanptrs[r]; ok {
return
Expand Down

0 comments on commit c0a8c25

Please sign in to comment.