Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not clone Schema, clone only when the inner struct is Bool #34

Merged
merged 1 commit into from
May 19, 2023

Conversation

6293
Copy link
Contributor

@6293 6293 commented May 19, 2023

follow-up for #32 (comment)

Previously DiffWalker::diff would receive SchemaObject instead of Schema. When we want to call the method recursively, however, this interface forces us to clone the schema, as the type for child schemas (subschemas, properties and array items) is Schema, not SchemaObject. Cloning should be performed only on boolean schema, because it is ok to clone boolean schema which is small, but not SchemaObject because the object could be huge depending on the user input.

@6293 6293 requested a review from a team as a code owner May 19, 2023 09:43
@6293 6293 changed the title do clone Schema; clone only when the inner struct is Bool do not clone Schema, clone only when the inner struct is Bool May 19, 2023
@untitaker untitaker merged commit 19d0fd5 into getsentry:main May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants