Skip to content

Commit d8e047b

Browse files
committed
Issue #4: checkForOkResponse() can't use ZEROCOPY if the String is passed by reference, and it's now. I believe this is a nicer pattern to improve mem usage
1 parent efc6c32 commit d8e047b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ String UniversalTelegramBot::sendPhoto(String chat_id, String photo,
758758
return sendPostPhoto(payload.as<JsonObject>());
759759
}
760760

761-
bool UniversalTelegramBot::checkForOkResponse(String response) {
761+
bool UniversalTelegramBot::checkForOkResponse(String &response) {
762762
int last_id;
763763
DynamicJsonDocument doc(response.length());
764764
deserializeJson(doc, response);

src/UniversalTelegramBot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class UniversalTelegramBot {
104104
bool setMyCommands(const String& commandArray);
105105

106106
int getUpdates(long offset);
107-
bool checkForOkResponse(String response);
107+
bool checkForOkResponse(String &response);
108108
telegramMessage messages[HANDLE_MESSAGES];
109109
long last_message_received;
110110
String name;

0 commit comments

Comments
 (0)