utils: refactor count_nl from mu-cmd-find

And update users.
Please enter the commit message for your changes. Lines starting
This commit is contained in:
Dirk-Jan C. Binnema
2025-07-27 19:37:48 +03:00
parent 28ea23a2a3
commit 8d3b65c5d8
2 changed files with 17 additions and 9 deletions

View File

@ -533,14 +533,6 @@ Mu::mu_cmd_find(const Store& store, const Options& opts)
static std::string test_mu_home;
auto count_nl(const std::string& s)->size_t {
size_t n{};
for (auto&& c: s)
if (c == '\n')
++n;
return n;
}
static size_t
search_func(const std::string& expr, size_t expected)
{