Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b0c04b4

Browse files
reserve the String Length in urlDecode to avoid String Reallocations
1 parent 2bb1b5a commit b0c04b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎libraries/ESP8266WebServer/src/Parsing-impl.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ String ESP8266WebServerTemplate<ServerType>::urlDecode(const String& text)
514514
char temp[] = "0x00";
515515
unsigned int len = text.length();
516516
unsigned int i = 0;
517+
decoded.reserve(len - (std::count(text.begin(), text.end(), '%') * 2));
517518
while (i < len)
518519
{
519520
char decodedChar;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /