1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-24 19:42:27 +03:00

Pass string objects by reference (#5378)

This commit is contained in:
dav1901
2018-11-25 16:18:44 +02:00
committed by Develo
parent 72ad9353fc
commit cd05bae0e8
10 changed files with 15 additions and 15 deletions

View File

@ -76,7 +76,7 @@ public:
void addService(const char *service, const char *proto, uint16_t port){
addService((char *)service, (char *)proto, port);
}
void addService(String service, String proto, uint16_t port){
void addService(const String& service, const String& proto, uint16_t port){
addService(service.c_str(), proto.c_str(), port);
}
@ -84,7 +84,7 @@ public:
bool addServiceTxt(const char *name, const char *proto, const char *key,const char * value){
return addServiceTxt((char *)name, (char *)proto, (char *)key, (char *)value);
}
bool addServiceTxt(String name, String proto, String key, String value){
bool addServiceTxt(const String& name, const String& proto, const String& key, const String& value){
return addServiceTxt(name.c_str(), proto.c_str(), key.c_str(), value.c_str());
}
@ -92,7 +92,7 @@ public:
int queryService(const char *service, const char *proto){
return queryService((char *)service, (char *)proto);
}
int queryService(String service, String proto){
int queryService(const String& service, const String& proto){
return queryService(service.c_str(), proto.c_str());
}
String hostname(int idx);