mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 00:31:31 -04:00
remove unused startFrom argument from Recipe
This commit is contained in:
parent
d78730edc0
commit
536a82684c
4 changed files with 7 additions and 9 deletions
|
@ -53,7 +53,7 @@ class Chef {
|
||||||
this.dish.set(input, type);
|
this.dish.set(input, type);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
progress = await recipe.execute(this.dish, progress);
|
progress = await recipe.execute(this.dish);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log.error(err);
|
log.error(err);
|
||||||
error = {
|
error = {
|
||||||
|
|
|
@ -169,25 +169,23 @@ class Recipe {
|
||||||
* Executes each operation in the recipe over the given Dish.
|
* Executes each operation in the recipe over the given Dish.
|
||||||
*
|
*
|
||||||
* @param {Dish} dish
|
* @param {Dish} dish
|
||||||
* @param {number} [startFrom=0]
|
|
||||||
* - The index of the Operation to start executing from
|
|
||||||
* @param {number} [forkState={}]
|
* @param {number} [forkState={}]
|
||||||
* - If this is a forked recipe, the state of the recipe up to this point
|
* - If this is a forked recipe, the state of the recipe up to this point
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
* - The final progress through the recipe
|
* - The final progress through the recipe
|
||||||
*/
|
*/
|
||||||
async execute(dish, startFrom=0, forkState={}) {
|
async execute(dish, forkState={}) {
|
||||||
let op, input, output,
|
let op, input, output,
|
||||||
numJumps = 0,
|
numJumps = 0,
|
||||||
numRegisters = forkState.numRegisters || 0;
|
numRegisters = forkState.numRegisters || 0;
|
||||||
|
|
||||||
if (startFrom === 0) this.lastRunOp = null;
|
this.lastRunOp = null;
|
||||||
|
|
||||||
await this._hydrateOpList();
|
await this._hydrateOpList();
|
||||||
|
|
||||||
log.debug(`[*] Executing recipe of ${this.opList.length} operations, starting at ${startFrom}`);
|
log.debug(`[*] Executing recipe of ${this.opList.length} operations`);
|
||||||
|
|
||||||
for (let i = startFrom; i < this.opList.length; i++) {
|
for (let i = 0; i < this.opList.length; i++) {
|
||||||
op = this.opList[i];
|
op = this.opList[i];
|
||||||
log.debug(`[${i}] ${op.name} ${JSON.stringify(op.ingValues)}`);
|
log.debug(`[${i}] ${op.name} ${JSON.stringify(op.ingValues)}`);
|
||||||
if (op.disabled) {
|
if (op.disabled) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ class Fork extends Operation {
|
||||||
dish.set(inputs[i], inputType);
|
dish.set(inputs[i], inputType);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
progress = await recipe.execute(dish, 0, state);
|
progress = await recipe.execute(dish, state);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!ignoreErrors) {
|
if (!ignoreErrors) {
|
||||||
throw err;
|
throw err;
|
||||||
|
|
|
@ -123,7 +123,7 @@ class Subsection extends Operation {
|
||||||
dish.set(matchStr, inputType);
|
dish.set(matchStr, inputType);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
progress = await recipe.execute(dish, 0, state);
|
progress = await recipe.execute(dish, state);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!ignoreErrors) {
|
if (!ignoreErrors) {
|
||||||
throw err;
|
throw err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue