Skip to content

Commit

Permalink
Optimise zio.http.endpoint.openapi.JsonSchema.fromZSchemaMulti
Browse files Browse the repository at this point in the history
Replace `.map(..).getOrElse(..)` with `.fold`
  • Loading branch information
guizmaii committed Dec 5, 2024
1 parent 1f8ef1f commit 3af354e
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

2 comments on commit 3af354e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 : Performance Benchmarks (PlainTextBenchmarkServer)

concurrency: 256
requests/sec: 350542

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 : Performance Benchmarks (SimpleEffectBenchmarkServer)

concurrency: 256
requests/sec: 348998

Please sign in to comment.