From d052d4061281dee884a9832c6826da95457a2c14 Mon Sep 17 00:00:00 2001 From: TheCrazyT Date: Sat, 18 Jun 2022 21:40:33 +0200 Subject: [PATCH] reduce redundant code in Bladeburner.tsx --- src/Bladeburner/Bladeburner.tsx | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index c45c421bd..90faff38e 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -795,21 +795,9 @@ export class Bladeburner implements IBladeburner { let i = 0; while (i < command.length) { const c = command.charAt(i); - if (c === '"') { - // Double quotes - const endQuote = command.indexOf('"', i + 1); - if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === " ")) { - args.push(command.substr(i + 1, endQuote - i - 1)); - if (endQuote === command.length - 1) { - start = i = endQuote + 1; - } else { - start = i = endQuote + 2; // Skip the space - } - continue; - } - } else if (c === "'") { - // Single quotes, same thing as above - const endQuote = command.indexOf("'", i + 1); + if ((c === '"')||(c === "'")) { + // Double quotes or Single quotes + const endQuote = command.indexOf(c, i + 1); if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === " ")) { args.push(command.substr(i + 1, endQuote - i - 1)); if (endQuote === command.length - 1) {