From d04c8ddc1a25e9bc06fe25cd4fa5587f46518868 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 19 Jul 2024 11:33:35 +0100 Subject: [PATCH] refactor(index): merge concurrent `array.push` calls --- index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 2ca8173..6a0b809 100644 --- a/index.js +++ b/index.js @@ -135,8 +135,7 @@ function serialize (cmpts, opts) { } if (options.reference !== 'suffix' && components.scheme) { - uriTokens.push(components.scheme) - uriTokens.push(':') + uriTokens.push(components.scheme, ':') } const authority = recomposeAuthority(components, options) @@ -166,13 +165,11 @@ function serialize (cmpts, opts) { } if (components.query !== undefined) { - uriTokens.push('?') - uriTokens.push(components.query) + uriTokens.push('?', components.query) } if (components.fragment !== undefined) { - uriTokens.push('#') - uriTokens.push(components.fragment) + uriTokens.push('#', components.fragment) } return uriTokens.join('') }