Skip to content

Commit

Permalink
Clean up utils::parse_ranges
Browse files Browse the repository at this point in the history
(cherry-picked from commit c068108)
  • Loading branch information
Vultraz committed Oct 7, 2018
1 parent c49917c commit 7b9688f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/serialization/string_utils.cpp
Expand Up @@ -831,16 +831,14 @@ std::pair<int, int> parse_range(const std::string& str)

std::vector<std::pair<int, int>> parse_ranges(const std::string& str)
{
std::vector< std::pair< int, int >> to_return;
std::vector<std::string> strs = utils::split(str);
std::vector<std::string>::const_iterator i, i_end=strs.end();
for(i = strs.begin(); i != i_end; ++i) {
to_return.push_back(parse_range(*i));
std::vector<std::pair<int, int>> to_return;
for(const std::string& r : utils::split(str)) {
to_return.push_back(parse_range(r));
}

return to_return;
}


void ellipsis_truncate(std::string& str, const std::size_t size)
{
const std::size_t prev_size = str.length();
Expand Down

0 comments on commit 7b9688f

Please sign in to comment.