mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-08 03:24:48 +01:00
Merge pull request #3852 from TheCrazyT/dev
BLADEBURNER: FIX reduce redundant code in Bladeburner.tsx
This commit is contained in:
@ -794,21 +794,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) === KEY.SPACE)) {
|
||||
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) === KEY.SPACE)) {
|
||||
args.push(command.substr(i + 1, endQuote - i - 1));
|
||||
if (endQuote === command.length - 1) {
|
||||
|
Reference in New Issue
Block a user