Skip to content

Commit

Permalink
optimize: reduce quantor allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Apr 13, 2018
1 parent e1b27e7 commit 92e9e9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions schema_props.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ func (s *schemaPropsValidator) SetPath(path string) {
}

func newSchemaPropsValidator(path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root interface{}, formats strfmt.Registry) *schemaPropsValidator {
var anyValidators []SchemaValidator
anyValidators := make([]SchemaValidator, 0, len(anyOf))
for _, v := range anyOf {
anyValidators = append(anyValidators, *NewSchemaValidator(&v, root, path, formats))
}
var allValidators []SchemaValidator
allValidators := make([]SchemaValidator, 0, len(allOf))
for _, v := range allOf {
allValidators = append(allValidators, *NewSchemaValidator(&v, root, path, formats))
}
var oneValidators []SchemaValidator
oneValidators := make([]SchemaValidator, 0, len(oneOf))
for _, v := range oneOf {
oneValidators = append(oneValidators, *NewSchemaValidator(&v, root, path, formats))
}
Expand Down

0 comments on commit 92e9e9b

Please sign in to comment.