mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-19 21:02:41 +00:00
Merge pull request #88 from Valorith/copilot/sub-pr-80-3de2c56e-01eb-4dbe-99cb-1a3d8f9ae362
Pass Strings::Implode unordered_set parameter by const reference
This commit is contained in:
commit
1bb872e900
@ -961,14 +961,14 @@ bool Strings::IsValidJson(const std::string &json)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string Strings::Implode(const std::string& glue, std::unordered_set<std::string> src)
|
||||
std::string Strings::Implode(const std::string& glue, const std::unordered_set<std::string>& src)
|
||||
{
|
||||
if (src.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::ostringstream output;
|
||||
std::unordered_set<std::string>::iterator src_iter;
|
||||
std::ostringstream output;
|
||||
std::unordered_set<std::string>::const_iterator src_iter;
|
||||
|
||||
for (src_iter = src.begin(); src_iter != src.end(); src_iter++) {
|
||||
output << *src_iter << glue;
|
||||
|
||||
@ -77,7 +77,7 @@ public:
|
||||
static std::string Escape(const std::string &s);
|
||||
static std::string GetBetween(const std::string &s, std::string start_delim, std::string stop_delim);
|
||||
static std::string Implode(const std::string& glue, std::vector<std::string> src);
|
||||
static std::string Implode(const std::string& glue, std::unordered_set<std::string> src);
|
||||
static std::string Implode(const std::string& glue, const std::unordered_set<std::string>& src);
|
||||
static std::string Join(const std::vector<std::string> &ar, const std::string &delim);
|
||||
static std::string Join(const std::vector<uint32_t> &ar, const std::string &delim);
|
||||
static std::string MillisecondsToTime(int duration);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user