From a3317607d0121368fa7152f84ed5e58b822c5114 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 21 Aug 2015 11:14:24 -0700 Subject: [PATCH] cleanups --- main.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.cc b/main.cc index acb6855..5878ed8 100644 --- a/main.cc +++ b/main.cc @@ -64,7 +64,7 @@ static bool ob_check_exec(ostd::ConstCharRange tname, } static int ob_exec_rule(ObState &os, ostd::ConstCharRange target, - ostd::ConstCharRange from = ostd::ConstCharRange()); + ostd::ConstCharRange from = nullptr); struct SubRule { ostd::ConstCharRange sub; @@ -147,14 +147,14 @@ static ostd::ConstCharRange ob_compare_subst(ostd::ConstCharRange expanded, auto rep = ostd::find(toexpand, '%'); /* no subst found */ if (rep.empty()) - return ostd::ConstCharRange(); + return nullptr; /* get the part before % */ auto fp = ostd::slice_until(toexpand, rep); /* part before % does not compare, so ignore */ if (expanded.size() <= fp.size()) - return ostd::ConstCharRange(); + return nullptr; if (expanded.slice(0, fp.size()) != fp) - return ostd::ConstCharRange(); + return nullptr; /* pop out front part */ expanded.pop_front_n(fp.size()); /* part after % */ @@ -163,9 +163,9 @@ static ostd::ConstCharRange ob_compare_subst(ostd::ConstCharRange expanded, return expanded; /* part after % does not compare, so ignore */ if (expanded.size() <= rep.size()) - return ostd::ConstCharRange(); + return nullptr; if (expanded.slice(expanded.size() - rep.size(), expanded.size()) != rep) - return ostd::ConstCharRange(); + return nullptr; /* cut off latter part */ expanded.pop_back_n(rep.size()); /* we got what we wanted... */