@@ -606,7 +606,7 @@ void OLEDDisplay::drawStringInternal(int16_t xMove, int16_t yMove, char* text, u
606606}
607607
608608
609- void OLEDDisplay::drawString (int16_t xMove, int16_t yMove, String strUser) {
609+ void OLEDDisplay::drawString (int16_t xMove, int16_t yMove, const String & strUser) {
610610 uint16_t lineHeight = pgm_read_byte (fontData + HEIGHT_POS);
611611
612612 // char* text must be freed!
@@ -644,7 +644,7 @@ void OLEDDisplay::drawStringf( int16_t x, int16_t y, char* buffer, String format
644644 drawString ( x, y, buffer );
645645}
646646
647- void OLEDDisplay::drawStringMaxWidth (int16_t xMove, int16_t yMove, uint16_t maxLineWidth, String strUser) {
647+ void OLEDDisplay::drawStringMaxWidth (int16_t xMove, int16_t yMove, uint16_t maxLineWidth, const String & strUser) {
648648 uint16_t firstChar = pgm_read_byte (fontData + FIRST_CHAR_POS);
649649 uint16_t lineHeight = pgm_read_byte (fontData + HEIGHT_POS);
650650
@@ -707,7 +707,7 @@ uint16_t OLEDDisplay::getStringWidth(const char* text, uint16_t length) {
707707 return max (maxWidth, stringWidth);
708708}
709709
710- uint16_t OLEDDisplay::getStringWidth (String strUser) {
710+ uint16_t OLEDDisplay::getStringWidth (const String & strUser) {
711711 char * text = utf8ascii (strUser);
712712 uint16_t length = strlen (text);
713713 uint16_t width = getStringWidth (text, length);
@@ -1074,7 +1074,7 @@ void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t widt
10741074}
10751075
10761076// You need to free the char!
1077- char * OLEDDisplay::utf8ascii (String str) {
1077+ char * OLEDDisplay::utf8ascii (const String & str) {
10781078 uint16_t k = 0 ;
10791079 uint16_t length = str.length () + 1 ;
10801080
0 commit comments