Skip to content

Commit 71c2b96

Browse files
committed
Small perf tweak
1 parent 88276e9 commit 71c2b96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

codegen/service/service_data.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,12 +1189,12 @@ func BuildSchemeData(s *expr.SchemeExpr, m *expr.MethodExpr) *SchemeData {
11891189
// just result types - because user types make contain result types and thus may
11901190
// need to be marshalled in different ways depending on the view being used.
11911191
func collectProjectedTypes(projected, att *expr.AttributeExpr, viewspkg string, scope, viewScope *codegen.NameScope, seen map[string]*ProjectedTypeData) (data []*ProjectedTypeData, umeths []*UnionValueMethodData) {
1192-
collect := func(projected, att *expr.AttributeExpr) ([]*ProjectedTypeData, []*UnionValueMethodData) {
1193-
return collectProjectedTypes(projected, att, viewspkg, scope, viewScope, seen)
1194-
}
11951192
if !hasResultType(att) {
11961193
return
11971194
}
1195+
collect := func(projected, att *expr.AttributeExpr) ([]*ProjectedTypeData, []*UnionValueMethodData) {
1196+
return collectProjectedTypes(projected, att, viewspkg, scope, viewScope, seen)
1197+
}
11981198
switch pt := projected.Type.(type) {
11991199
case expr.UserType:
12001200
dt := att.Type.(expr.UserType)

0 commit comments

Comments
 (0)