summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-22 23:28:47 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-22 23:28:47 +0300
commit76886a84c8c197a1f46f711e15569b6991e5555a (patch)
treedaaa2beaa5da04282405e9d0a4d0eb064a18c535 /src/utils/stringutils.cpp
parent218e1b2d09ba7be306cce3b4e2ef92a257466ef2 (diff)
downloadmanaverse-76886a84c8c197a1f46f711e15569b6991e5555a.tar.gz
manaverse-76886a84c8c197a1f46f711e15569b6991e5555a.tar.bz2
manaverse-76886a84c8c197a1f46f711e15569b6991e5555a.tar.xz
manaverse-76886a84c8c197a1f46f711e15569b6991e5555a.zip
improve function for splitting string to ints.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index a0e31f06d..69474bd93 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -396,16 +396,14 @@ std::string normalize(const std::string &name)
return toLower(trim(normalized));
}
-std::set<int> splitToIntSet(const std::string &text,
- const char separator)
+void splitToIntSet(std::set<int> &tokens,
+ const std::string &text,
+ const char separator)
{
- std::set<int> tokens;
std::stringstream ss(text);
std::string item;
while (std::getline(ss, item, separator))
tokens.insert(atoi(item.c_str()));
-
- return tokens;
}
std::list<int> splitToIntList(const std::string &text,