Skip to content

Commit 640d701

Browse files
committed
small refactor to avoid const creation
1 parent ad06017 commit 640d701

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/slang-printers/print-function.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ export function printFunction(
1313
node: FunctionLike,
1414
print: PrintFunction
1515
): Doc {
16-
const body = (node as FunctionWithBody).body;
17-
1816
return group([
1917
functionName,
2018
print('parameters'),
2119
indent(
2220
group([
2321
joinExisting(line, [print('attributes'), print('returns')]),
24-
body && body.kind === NonterminalKind.Block ? dedent(line) : ''
22+
(node as FunctionWithBody).body?.kind === NonterminalKind.Block
23+
? dedent(line)
24+
: ''
2525
])
2626
)
2727
]);

0 commit comments

Comments
 (0)