diff options
| author | Tilka <tilkax@gmail.com> | 2017-06-11 16:05:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-11 16:05:14 +0100 |
| commit | 1bf62cc0846fb295356c7f2a090d690c9ee8c57c (patch) | |
| tree | c878aa70b36738fd77fa9300ce63b87713b23aff /Source/Core/Common/StringUtil.cpp | |
| parent | 937d72e59192be43da89e44a0d9f1dbf10ac7a94 (diff) | |
| parent | 17ef4c8046fd9eccdf074b72ceb981710552a6b1 (diff) | |
Merge pull request #5596 from leoetlino/return-by-value
StringUtil: Make SplitString return by value
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 6548205fb0..1536173eb7 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -341,15 +341,16 @@ void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _P _CompleteFilename += _Filename; } -void SplitString(const std::string& str, const char delim, std::vector<std::string>& output) +std::vector<std::string> SplitString(const std::string& str, const char delim) { std::istringstream iss(str); - output.resize(1); + std::vector<std::string> output(1); while (std::getline(iss, *output.rbegin(), delim)) output.push_back(""); output.pop_back(); + return output; } std::string JoinStrings(const std::vector<std::string>& strings, const std::string& delimiter) |
