From e15907f3f1df8e26c7ef24d9d99a6123c3abfabf Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 7 Sep 2014 17:32:46 -0400 Subject: [PATCH] Code Cleanup - Removed unused uti.cpp indentTree function. --- src/util.cpp | 14 -------------- src/util.h | 5 ----- test/util.t.cpp | 19 +------------------ 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 7f0a0e5e6..51ffff114 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -347,20 +347,6 @@ int execute ( // - delimiter is the character used to split up projects into subprojects. // - defaults to the period, '.' // -const std::vector indentTree ( - const std::vector& values, - const std::string& whitespace /* = " " */, - char delimiter/* = '.' */) -{ - std::vector modified; - std::vector ::const_iterator i; - for (i = values.begin (); i != values.end (); ++i) - modified.push_back (indentProject (*i, whitespace, delimiter)); - - return modified; -} - -//////////////////////////////////////////////////////////////////////////////// const std::string indentProject ( const std::string& project, const std::string& whitespace /* = " " */, diff --git a/src/util.h b/src/util.h index b64035f60..502e3e22a 100644 --- a/src/util.h +++ b/src/util.h @@ -61,11 +61,6 @@ int execute (const std::string&, const std::vector &, const std::st int flock (int, int); #endif -const std::vector indentTree ( - const std::vector&, - const std::string& whitespace = " ", - char delimiter = '.'); - const std::string indentProject ( const std::string&, const std::string& whitespace = " ", diff --git a/test/util.t.cpp b/test/util.t.cpp index 6eaf2d021..0de183c9c 100644 --- a/test/util.t.cpp +++ b/test/util.t.cpp @@ -36,7 +36,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (29); + UnitTest t (23); // Ensure environment has no influence. unsetenv ("TASKDATA"); @@ -89,23 +89,6 @@ int main (int argc, char** argv) output = taskDifferences (right, rightAgain); t.ok (output.find ("No changes will be made") != std::string::npos, "No changes detected"); - // see also indirect tests of indentProject and extractParents in `project.t'. - // std::vector indentTree (const std::vector&, const std::string whitespace=" ", char delimiter='.'); - std::vector flat; - flat.push_back ("one"); - flat.push_back ("one.two"); - flat.push_back ("one.two.three"); - flat.push_back ("one.four"); - flat.push_back ("two"); - - std::vector structured = indentTree (flat, " ", '.'); - t.is (structured.size (), (size_t) 5, "indentTree yields 5 strings"); - t.is (structured[0], "one", "indentTree 'one' -> 'one'"); - t.is (structured[1], " two", "indentTree 'one.two' -> ' two'"); - t.is (structured[2], " three", "indentTree 'one.two.three' -> ' three'"); - t.is (structured[3], " four", "indentTree 'one.four' -> ' four'"); - t.is (structured[4], "two", "indentTree 'two' -> 'two'"); - // std::vector indentProject (const std::string&, const std::string whitespace=" ", char delimiter='.'); t.is (indentProject (""), "", "indentProject '' -> ''"); t.is (indentProject ("one"), "one", "indentProject 'one' -> 'one'");