Skip to content

Commit

Permalink
Optimise zio.http.endpoint.openapi.JsonSchema.fromZSchemaMulti (#3239)
Browse files Browse the repository at this point in the history
Replace `.map(..).getOrElse(..)` with `.fold`

Co-authored-by: Nabil Abdel-Hafeez <[email protected]>
  • Loading branch information
guizmaii and 987Nabil authored Dec 14, 2024
1 parent e82ca17 commit ae467dd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ object JsonSchema {
refType,
seenWithCurrent,
)
nested.rootRef.map(k => nested.children + (k -> nested.root)).getOrElse(nested.children)
nested.rootRef.fold(ifEmpty = nested.children)(k => nested.children + (k -> nested.root))
}
.toMap
JsonSchemas(fromZSchema(record, SchemaStyle.Inline), ref, children)
Expand Down

0 comments on commit ae467dd

Please sign in to comment.