diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-11 20:24:14 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-11 20:26:46 -0700 |
commit | ccba671853b44147a95138581c580fce76653e57 (patch) | |
tree | 1d92fc4a2c1ea667fba2abad8be799f5916d7784 /020run.cc | |
parent | b3899909d60fb6dc48cef73d6d28dbd89fe72442 (diff) | |
download | mu-ccba671853b44147a95138581c580fce76653e57.tar.gz |
3335
Clean up rest of long-standing bit of ugliness. I'm growing more confident now that I can use layers to cleanly add any functionality I want. All I need is hook functions. No need to ever put '{' on their own line, or add arguments to calls.
Diffstat (limited to '020run.cc')
-rw-r--r-- | 020run.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/020run.cc b/020run.cc index e60e75ac..8f27c820 100644 --- a/020run.cc +++ b/020run.cc @@ -57,8 +57,7 @@ void run(recipe_ordinal r) { } void run_current_routine() { - while (!Current_routine->completed()) // later layers will modify condition - { + while (should_continue_running(Current_routine)) { // beware: later layers modify Current_routine here // Running One Instruction if (current_instruction().is_label) { ++current_step_index(); continue; } trace(Initial_callstack_depth + Trace_stream->callstack_depth, "run") << to_string(current_instruction()) << end(); @@ -101,6 +100,11 @@ void run_current_routine() { stop_running_current_routine:; } +bool should_continue_running(const routine* current_routine) { + assert(current_routine == Current_routine); // argument passed in just to make caller readable above + return !Current_routine->completed(); +} + bool should_copy_ingredients() { // End should_copy_ingredients Special-cases return true; |