remove unused startFrom argument from Recipe

This commit is contained in:
d98762625 2020-03-03 17:51:51 +00:00
parent d78730edc0
commit 536a82684c
4 changed files with 7 additions and 9 deletions

View file

@ -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 = {

View file

@ -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) {

View file

@ -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;

View file

@ -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;