mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Remove unused code, some string_view
This commit is contained in:
@@ -334,7 +334,7 @@ void SplitString(std::string_view str, const char delim, std::vector<std::string
|
||||
}
|
||||
}
|
||||
|
||||
static std::string ApplyHtmlEscapes(std::string str) {
|
||||
static std::string ApplyHtmlEscapes(std::string_view str_view) {
|
||||
struct Repl {
|
||||
const char *a;
|
||||
const char *b;
|
||||
@@ -345,15 +345,15 @@ static std::string ApplyHtmlEscapes(std::string str) {
|
||||
// Easy to add more cases.
|
||||
};
|
||||
|
||||
std::string str(str_view);
|
||||
for (const Repl &r : replacements) {
|
||||
str = ReplaceAll(str, r.a, r.b);
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
// Meant for HTML listings and similar, so supports some HTML escapes.
|
||||
void GetQuotedStrings(const std::string& str, std::vector<std::string> &output) {
|
||||
void GetQuotedStrings(std::string_view str, std::vector<std::string> &output) {
|
||||
size_t next = 0;
|
||||
bool even = 0;
|
||||
for (size_t pos = 0, len = str.length(); pos < len; ++pos) {
|
||||
@@ -372,11 +372,11 @@ void GetQuotedStrings(const std::string& str, std::vector<std::string> &output)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: this is quite inefficient.
|
||||
std::string ReplaceAll(std::string_view input, std::string_view src, std::string_view dest) {
|
||||
size_t pos = 0;
|
||||
|
||||
std::string result(input);
|
||||
|
||||
if (src == dest)
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user