Performance
- Added a shortcut test that speeds up the decode process for most cases.
This commit is contained in:
@@ -515,6 +515,8 @@ const std::string encode (const std::string& value)
|
|||||||
// ] <- &close;
|
// ] <- &close;
|
||||||
// : <- :
|
// : <- :
|
||||||
const std::string decode (const std::string& value)
|
const std::string decode (const std::string& value)
|
||||||
|
{
|
||||||
|
if (value.find ('&') != std::string::npos)
|
||||||
{
|
{
|
||||||
std::string modified = value;
|
std::string modified = value;
|
||||||
|
|
||||||
@@ -534,6 +536,9 @@ const std::string decode (const std::string& value)
|
|||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Escapes any unescaped character of type c within the given string
|
// Escapes any unescaped character of type c within the given string
|
||||||
// e.g. ' ' -> '\ '
|
// e.g. ' ' -> '\ '
|
||||||
|
|||||||
Reference in New Issue
Block a user