From: Ian Jackson Date: Sat, 10 Jul 2021 12:36:36 +0000 (+0100) Subject: script: lower: Bail early if no targets X-Git-Tag: otter-0.7.2~159 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=552f62adf0957a35113f55594144d2422a0ab2d0;p=otter.git script: lower: Bail early if no targets Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 150353b0..e43819c1 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -646,10 +646,13 @@ function lower_pieces(targets_todo: LowerTodoList): let bottommost_unbottom : Entry | null = null; let n_targets_todo_unbottom = 0; + let any_targets = false; for (const piece of Object.keys(targets_todo)) { + any_targets = true; let p = targets_todo[piece]; if (!p.bottom) n_targets_todo_unbottom++; } + if (!any_targets) return 'Nothing to lower!'; let walk = pieces_marker; for (;;) { // starting at the bottom of the stack order