Skip to content

Commit 33f2c24

Browse files
committed
reserve String space to avoid bad memory re-allocating
1 parent 7a4283d commit 33f2c24

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ESP_WiFiManager_Lite.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,7 @@ class ESP_WiFiManager_Lite
26642664
void createHTML(String& root_html_template)
26652665
{
26662666
String pitem;
2667+
pitem.reserve(600);
26672668

26682669
root_html_template = FPSTR(ESP_WM_LITE_HTML_HEAD_START);
26692670

@@ -2805,6 +2806,7 @@ class ESP_WiFiManager_Lite
28052806
//////
28062807

28072808
String result;
2809+
result.reserve(3072);
28082810
createHTML(result);
28092811

28102812
//ESP_WML_LOGDEBUG1(F("h:Repl:"), result);

0 commit comments

Comments
 (0)