-
Notifications
You must be signed in to change notification settings - Fork 51
[MutabilityWithReadOnly] Optimize to prevent excessive memory usage on large specs #813
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
Changes from 14 commits
98df3f9
6891fac
93c4e14
af3e536
7142114
b71fdb6
aaf7003
ab900ea
410cf09
7d055aa
a61fd2f
3d9eca9
7b0dfe4
7d9c1ff
573ada9
c2ad655
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,11 +4,8 @@ export const mutabilityWithReadOnly = (prop: any, _opts: any, ctx: any) => { | |
| if (prop === null || typeof prop !== "object") { | ||
| return []; | ||
| } | ||
| if ( | ||
| prop.readOnly === undefined || | ||
| prop["x-ms-mutability"] === undefined || | ||
| prop["x-ms-mutability"].length === 0 | ||
| ) { | ||
| // The "given" clause already filters for "readOnly !== undefined" and "x-ms-mutability !== undefined" | ||
| if (prop["x-ms-mutability"].length === 0) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot :
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great question! Here's the analysis: Moving to
Keeping in function:
Recommendation: Keep in function. The performance difference is negligible since we already filter out ~99% of properties in the |
||
| return []; | ||
| } | ||
| const path = ctx.path || []; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.