From 32b728b7e9ef2505220e8a4d7dffb4bfda94e16e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 20 Sep 2021 21:33:48 +0300 Subject: Optimize options/arguments parsing --- build2/b.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build2/b.cxx b/build2/b.cxx index 8e9b154..f0f5a7a 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -280,6 +280,12 @@ main (int argc, char* argv[]) { if (opt) { + // Parse the next chunk of options until we reach an argument (or + // eos). + // + if (ops.parse (scan) && !scan.more ()) + break; + // If we see first "--", then we are done parsing options. // if (strcmp (scan.peek (), "--") == 0) @@ -289,12 +295,6 @@ main (int argc, char* argv[]) continue; } - // Parse the next chunk of options until we reach an argument (or - // eos). - // - if (ops.parse (scan)) - continue; - // Fall through. } -- cgit v1.1