diff --git a/src/TinyGsmClientBG96.h b/src/TinyGsmClientBG96.h index 11096785..a123f868 100644 --- a/src/TinyGsmClientBG96.h +++ b/src/TinyGsmClientBG96.h @@ -484,7 +484,7 @@ class TinyGsmBG96 : public TinyGsmModem, * NTP server functions */ - byte NTPServerSyncImpl(String server = "pool.ntp.org", byte = -5) { + byte NTPServerSyncImpl(const String& server = "pool.ntp.org", byte = -5) { // Request network synchronization // AT+QNTP=,[,][,] sendAT(GF("+QNTP=1,\""), server, '"'); diff --git a/src/TinyGsmHttpsA76xx.h b/src/TinyGsmHttpsA76xx.h index a10ea3b9..01cf8169 100644 --- a/src/TinyGsmHttpsA76xx.h +++ b/src/TinyGsmHttpsA76xx.h @@ -269,7 +269,7 @@ class TinyGsmHttpsA76xx return -1; } - int https_post(String payload) + int https_post(const String& payload) { return https_post((uint8_t *) payload.c_str(), payload.length()); } diff --git a/src/TinyGsmNTP.tpp b/src/TinyGsmNTP.tpp index aaeda7e7..5af2ac91 100644 --- a/src/TinyGsmNTP.tpp +++ b/src/TinyGsmNTP.tpp @@ -21,7 +21,7 @@ class TinyGsmNTP { */ public: - bool TinyGsmIsValidNumber(String str) { + bool TinyGsmIsValidNumber(const String& str) { if (!(str.charAt(0) == '+' || str.charAt(0) == '-' || isDigit(str.charAt(0)))) return false; @@ -32,7 +32,7 @@ class TinyGsmNTP { return true; } - byte NTPServerSync(String server = "pool.ntp.org", byte TimeZone = 3) { + byte NTPServerSync(const String& server = "pool.ntp.org", byte TimeZone = 3) { return thisModem().NTPServerSyncImpl(server, TimeZone); } String ShowNTPError(byte error) { @@ -54,7 +54,7 @@ class TinyGsmNTP { * NTP server functions */ protected: - byte NTPServerSyncImpl(String server = "pool.ntp.org", byte TimeZone = 3) { + byte NTPServerSyncImpl(const String& server = "pool.ntp.org", byte TimeZone = 3) { // Set GPRS bearer profile to associate with NTP sync // this may fail, it's not supported by all modules thisModem().sendAT(GF("+CNTPCID=1"));