diff --git a/src/util.cpp b/src/util.cpp index df0520c5e..14e0e7530 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -267,61 +267,6 @@ int flock (int fd, int operation) } #endif -//////////////////////////////////////////////////////////////////////////////// -// The vector must be sorted first. This is a modified version of the run- -// length encoding algorithm. -// -// This function converts the vector: -// -// [1, 3, 4, 6, 7, 8, 9, 11] -// -// to ths string: -// -// 1,3-4,6-9,11 -// -std::string compressIds (const std::vector & ids) -{ - std::stringstream result; - - int range_start = 0; - int range_end = 0; - - for (unsigned int i = 0; i < ids.size (); ++i) - { - if (i + 1 == ids.size ()) - { - if (result.str ().length ()) - result << ","; - - if (range_start < range_end) - result << ids[range_start] << "-" << ids[range_end]; - else - result << ids[range_start]; - } - else - { - if (ids[range_end] + 1 == ids[i + 1]) - { - ++range_end; - } - else - { - if (result.str ().length ()) - result << ","; - - if (range_start < range_end) - result << ids[range_start] << "-" << ids[range_end]; - else - result << ids[range_start]; - - range_start = range_end = i + 1; - } - } - } - - return result.str (); -} - //////////////////////////////////////////////////////////////////////////////// void combine (std::vector & dest, const std::vector & source) { diff --git a/src/util.h b/src/util.h index 67600c790..406ec0fb1 100644 --- a/src/util.h +++ b/src/util.h @@ -61,7 +61,6 @@ int execute (const std::string&, const std::vector &, const std::st int flock (int, int); #endif -std::string compressIds (const std::vector &); void combine (std::vector &, const std::vector &); unsigned burndown_size (unsigned ntasks);