From f5ba504e7fdd1800b349599b14d7543b440d6310 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 19 Nov 2024 18:58:25 +0100 Subject: [PATCH] Change comment and the order of operations to make it more obvious --- src/RNTupleReader.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RNTupleReader.cc b/src/RNTupleReader.cc index c2ef67a21..db5ab4dee 100644 --- a/src/RNTupleReader.cc +++ b/src/RNTupleReader.cc @@ -152,10 +152,10 @@ std::unique_ptr RNTupleReader::readEntry(const std::string& categ // m_readerEntries contains the accumulated entries for all the readers // therefore, the first number that is lower or equal to the entry number - // is the index of the reader that contains the entry + // is at the index of the reader that contains the entry auto upper = std::ranges::upper_bound(m_readerEntries[category], entNum); auto localEntry = entNum - *(upper - 1); - auto readerIndex = upper - m_readerEntries[category].begin() - 1; + auto readerIndex = upper - 1 - m_readerEntries[category].begin(); ROOTFrameData::BufferMap buffers; #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 31, 0)