From 2776f61a2d9b53df14071292be494eef9f972aeb Mon Sep 17 00:00:00 2001
From: Enrico Guiraud <enrico.guiraud@cern.ch>
Date: Wed, 30 May 2018 12:01:38 +0200
Subject: [PATCH] [TREEPROCMT] Quit loop over TEntryList as soon as we exceed
 range

---
 tree/treeplayer/inc/ROOT/TTreeProcessorMT.hxx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tree/treeplayer/inc/ROOT/TTreeProcessorMT.hxx b/tree/treeplayer/inc/ROOT/TTreeProcessorMT.hxx
index ba8271e25b9..2ddf2cb5d27 100644
--- a/tree/treeplayer/inc/ROOT/TTreeProcessorMT.hxx
+++ b/tree/treeplayer/inc/ROOT/TTreeProcessorMT.hxx
@@ -166,7 +166,9 @@ namespace ROOT {
             auto elist = std::make_unique<TEntryList>();
             Long64_t entry = fEntryList.GetEntry(0);
             do {
-               if (entry >= start && entry < end) // TODO can quit this loop early when entry >= end
+               if (entry >= end)
+                  break;
+               else if (entry >= start)
                   elist->Enter(entry);
             } while ((entry = fEntryList.Next()) >= 0);
 
-- 
GitLab