mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-26 07:02:15 +03:00
Further const correctness / String by reference passing cleanups (#6571)
There are actually several instances where we pass in read-only parameters as pass-by-value, where in the case of String() that is inefficient as it involves copy-constructor/temp string creations. We can avoid that, similarly to single character string concatenations done via string literals instead of char literals.
This commit is contained in:
committed by
david gauchard
parent
ba971fe7e9
commit
8bc5a10d6d
@ -277,7 +277,7 @@ bool MDNSResponder::addServiceTxt(char *name, char *proto, char *key, char *valu
|
||||
return false; //max txt record size
|
||||
}
|
||||
MDNSTxt *newtxt = new MDNSTxt;
|
||||
newtxt->_txt = String(key) + "=" + String(value);
|
||||
newtxt->_txt = String(key) + '=' + String(value);
|
||||
newtxt->_next = 0;
|
||||
if (servicePtr->_txts == 0) //no services have been added
|
||||
{
|
||||
|
Reference in New Issue
Block a user