Minor improvements.

This commit is contained in:
levlam 2024-04-25 16:37:20 +03:00
parent 73ccba7f0f
commit 337b193026
2 changed files with 3 additions and 4 deletions

View File

@ -19,6 +19,7 @@
#include "td/telegram/MessageCopyOptions.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/MessageQuote.h"
#include "td/telegram/MessageSelfDestructType.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/ReplyMarkup.h"

View File

@ -12,10 +12,8 @@
#include "td/telegram/OptionManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserManager.h"
#include "td/utils/algorithm.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/Slice.h"
#include "td/utils/utf8.h"
@ -192,8 +190,8 @@ int32 MessageQuote::search_quote(FormattedText &&text, FormattedText &&quote, in
fix_entities(text.entities);
remove_empty_entities(text.entities);
};
int32 length = narrow_cast<int32>(utf8_utf16_length(text.text));
int32 quote_length = narrow_cast<int32>(utf8_utf16_length(quote.text));
auto length = narrow_cast<int32>(utf8_utf16_length(text.text));
auto quote_length = narrow_cast<int32>(utf8_utf16_length(quote.text));
if (quote_length == 0 || quote_length > length) {
return -1;
}