From c3af2570cdd5e136d5f871228ae1f5ab0baa3d7c Mon Sep 17 00:00:00 2001 From: Valery Mironov <32071355+MBkkt@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:45:02 +0200 Subject: [PATCH] Try to improve read_documents (#568) * Update formats_burst_trie.cpp * Update formats_burst_trie.cpp --- core/formats/formats_burst_trie.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/formats/formats_burst_trie.cpp b/core/formats/formats_burst_trie.cpp index 644537ac3..8fc19c1ff 100644 --- a/core/formats/formats_burst_trie.cpp +++ b/core/formats/formats_burst_trie.cpp @@ -3208,7 +3208,8 @@ class field_reader final : public irs::field_reader { size_t read_documents(bytes_view term, std::span docs) const final { - if (IRS_UNLIKELY(docs.empty())) { + // Order is important here! + if (max() < term || term < min() || docs.empty()) { return 0; }