mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Cleanup] Cleanup uses of Strings::ToInt to match correct type. (#3054)
* [Cleanup] Cleanup uses of Strings::ToInt to match correct type. * cleanup
This commit is contained in:
+8
-8
@@ -115,7 +115,7 @@ Strings::SearchDelim(const std::string &haystack, const std::string &needle, con
|
||||
}
|
||||
|
||||
|
||||
std::string Strings::Implode(std::string glue, std::vector<std::string> src)
|
||||
std::string Strings::Implode(const std::string& glue, std::vector<std::string> src)
|
||||
{
|
||||
if (src.empty()) {
|
||||
return {};
|
||||
@@ -272,7 +272,7 @@ std::string Strings::Repeat(std::string s, int n)
|
||||
return s;
|
||||
}
|
||||
|
||||
bool Strings::Contains(std::vector<std::string> container, std::string element)
|
||||
bool Strings::Contains(std::vector<std::string> container, const std::string& element)
|
||||
{
|
||||
return std::find(container.begin(), container.end(), element) != container.end();
|
||||
}
|
||||
@@ -316,7 +316,7 @@ const std::string Strings::ToUpper(std::string s)
|
||||
);
|
||||
return s;
|
||||
}
|
||||
const std::string Strings::UcFirst(std::string s)
|
||||
const std::string Strings::UcFirst(const std::string& s)
|
||||
{
|
||||
std::string output = s;
|
||||
if (!s.empty()) {
|
||||
@@ -327,7 +327,7 @@ const std::string Strings::UcFirst(std::string s)
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::string> Strings::Wrap(std::vector<std::string> &src, std::string character)
|
||||
std::vector<std::string> Strings::Wrap(std::vector<std::string> &src, const std::string& character)
|
||||
{
|
||||
std::vector<std::string> new_vector;
|
||||
new_vector.reserve(src.size());
|
||||
@@ -659,7 +659,7 @@ std::string Strings::SecondsToTime(int duration, bool is_milliseconds)
|
||||
return time_string;
|
||||
}
|
||||
|
||||
std::string &Strings::LTrim(std::string &str, const std::string &chars)
|
||||
std::string &Strings::LTrim(std::string &str, std::string_view chars)
|
||||
{
|
||||
str.erase(0, str.find_first_not_of(chars));
|
||||
return str;
|
||||
@@ -670,7 +670,7 @@ std::string Strings::MillisecondsToTime(int duration)
|
||||
return SecondsToTime(duration, true);
|
||||
}
|
||||
|
||||
std::string &Strings::RTrim(std::string &str, const std::string &chars)
|
||||
std::string &Strings::RTrim(std::string &str, std::string_view chars)
|
||||
{
|
||||
str.erase(str.find_last_not_of(chars) + 1);
|
||||
return str;
|
||||
@@ -682,7 +682,7 @@ std::string &Strings::Trim(std::string &str, const std::string &chars)
|
||||
}
|
||||
|
||||
// Function to convert single digit or two digit number into words
|
||||
std::string Strings::ConvertToDigit(int n, std::string suffix)
|
||||
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
||||
{
|
||||
// if n is zero
|
||||
if (n == 0) {
|
||||
@@ -745,7 +745,7 @@ uint32 Strings::TimeToSeconds(std::string time_string)
|
||||
return duration;
|
||||
}
|
||||
|
||||
bool Strings::ToBool(std::string bool_string)
|
||||
bool Strings::ToBool(const std::string& bool_string)
|
||||
{
|
||||
if (
|
||||
Strings::Contains(bool_string, "true") ||
|
||||
|
||||
Reference in New Issue
Block a user