From b2a175463fec07ea5216faa1b586669221103275 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 10 Mar 2020 16:43:09 +0300 Subject: [PATCH] Improve logging on failed check_is_sorted check. GitOrigin-RevId: 756039b50c69c4b3d5d07ff7b671801726e4a6dc --- td/telegram/MessageEntity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index 57b6c004..2f2677f8 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -1142,8 +1142,9 @@ vector> find_urls(Slice str) { return result; } -static void check_is_sorted(const vector &entities) { - CHECK(std::is_sorted(entities.begin(), entities.end())); +#define check_is_sorted(entities) check_is_sorted_impl(entities, __LINE__) +static void check_is_sorted_impl(const vector &entities, int line) { + LOG_CHECK(std::is_sorted(entities.begin(), entities.end())) << line << " " << entities; } static void check_non_intersecting(const vector &entities) {