diff --git a/src/util.cpp b/src/util.cpp index 14e0e7530..e99ce81fc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -44,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -58,12 +56,6 @@ extern Context context; -//////////////////////////////////////////////////////////////////////////////// -static inline unsigned round_up_to (unsigned n, unsigned target) -{ - return n + target - (n % target); -} - //////////////////////////////////////////////////////////////////////////////// // Uses std::getline, because std::cin eats leading whitespace, and that means // that if a newline is entered, std::cin eats it and never returns from the @@ -356,44 +348,6 @@ int execute ( // Collides with std::numeric_limits methods #undef max -//////////////////////////////////////////////////////////////////////////////// -unsigned burndown_size (unsigned ntasks) -{ - // Nearest 2 - if (ntasks < 20) - return round_up_to (ntasks, 2); - - // Nearest 10 - if (ntasks < 50) - return round_up_to (ntasks, 10); - - // Nearest 20 - if (ntasks < 100) - return round_up_to (ntasks, 20); - - // Choose the number from here rounded up to the nearest 10% of the next - // highest power of 10 or half of power of 10. - const unsigned count = (unsigned) log10 (std::numeric_limits::max ()); - unsigned half = 500; - unsigned full = 1000; - - // We start at two because we handle 5, 10, 50, and 100 above. - for (unsigned i = 2; i < count; ++i) - { - if (ntasks < half) - return round_up_to (ntasks, half / 10); - - if (ntasks < full) - return round_up_to (ntasks, full / 10); - - half *= 10; - full *= 10; - } - - // Round up to max of unsigned. - return std::numeric_limits::max (); -} - //////////////////////////////////////////////////////////////////////////////// // Encode values prior to serialization. // [ -> &open; diff --git a/src/util.h b/src/util.h index 406ec0fb1..0a1647318 100644 --- a/src/util.h +++ b/src/util.h @@ -63,8 +63,6 @@ int execute (const std::string&, const std::vector &, const std::st void combine (std::vector &, const std::vector &); -unsigned burndown_size (unsigned ntasks); - const std::string encode (const std::string&); const std::string decode (const std::string&);