From b64fc5d52f40beb41078ca49ca00e213efffd26c Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 21 Jun 2017 21:02:16 +0200 Subject: [PATCH] merge ob_check_ts --- main.cc | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/main.cc b/main.cc index 03e7df5..c01f142 100644 --- a/main.cc +++ b/main.cc @@ -42,9 +42,17 @@ struct build_error: std::runtime_error { /* check funcs */ -static bool ob_check_ts( +static bool ob_check_exec( string_range tname, std::vector const &deps ) { + if (!fs::exists(std::string{tname})) { + return true; + } + for (auto &dep: deps) { + if (!fs::exists(dep)) { + return true; + } + } auto get_ts = [](string_range fname) { fs::path p{std::string{fname}}; if (!fs::is_regular_file(p)) { @@ -65,20 +73,6 @@ static bool ob_check_ts( return false; } -static bool ob_check_exec( - string_range tname, std::vector const &deps -) { - if (!fs::exists(std::string{tname})) { - return true; - } - for (auto &dep: deps) { - if (!fs::exists(dep)) { - return true; - } - } - return ob_check_ts(tname, deps); -} - /* this lets us properly match % patterns in target names */ static string_range ob_compare_subst( string_range expanded, string_range toexpand