Skip to content

Commit

Permalink
Identify massive deopt
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Nov 28, 2024
1 parent e87c74c commit 9b884ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
11 changes: 2 additions & 9 deletions src/language/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ const printDocASTReducer: ASTReducer<string> = {
SchemaDefinition: {
leave: ({ description, directives, operationTypes }) =>
wrap('', description, '\n') +
maybeJoin(
['schema', maybeJoin(directives, ' '), block(operationTypes)],
' ',
),
maybeJoin(['schema', join(directives, ' '), block(operationTypes)], ' '),
},

OperationTypeDefinition: {
Expand Down Expand Up @@ -320,13 +317,9 @@ const printDocASTReducer: ASTReducer<string> = {
* print all items together separated by separator if provided
*/
function maybeJoin(
maybeArray: Maybe<ReadonlyArray<string | undefined>>,
maybeArray: ReadonlyArray<string | undefined>,
separator = '',
): string {
if (!maybeArray) {
return '';
}

const list = maybeArray.filter((x) => x);
const listLength = list.length;
let result = '';
Expand Down
5 changes: 1 addition & 4 deletions src/language/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,7 @@ export function visit(
}
}
} else {
node = Object.defineProperties(
{},
Object.getOwnPropertyDescriptors(node),
);
node = { ...node };
for (const [editKey, editValue] of edits) {
node[editKey] = editValue;
}
Expand Down

0 comments on commit 9b884ef

Please sign in to comment.