mirror of https://github.com/aria2/aria2
Add fast-path to percentEncode(string&)
parent
72c5aaa31a
commit
1b8de6bb18
|
@ -433,6 +433,10 @@ std::string percentEncode(const unsigned char* target, size_t len)
|
|||
|
||||
std::string percentEncode(const std::string& target)
|
||||
{
|
||||
if (std::find_if_not(target.begin(), target.end(),
|
||||
inRFC3986UnreservedChars) == target.end()) {
|
||||
return target;
|
||||
}
|
||||
return percentEncode(reinterpret_cast<const unsigned char*>(target.c_str()),
|
||||
target.size());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue