From ce7f33df98f06dc431748b65f100ed55884df737 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Wed, 6 Mar 2024 12:59:26 +0100 Subject: [PATCH] [thstack] simplify THStack::Print() No need to cast histograms to call Print() methods --- hist/hist/src/THStack.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hist/hist/src/THStack.cxx b/hist/hist/src/THStack.cxx index 72b6e0c0353c1..7d38d31532b3f 100644 --- a/hist/hist/src/THStack.cxx +++ b/hist/hist/src/THStack.cxx @@ -989,13 +989,9 @@ void THStack::BuildAndPaint(Option_t *choptin, Bool_t paint) void THStack::Print(Option_t *option) const { - TH1 *h; - if (fHists) { - TIter next(fHists); - while ((h = (TH1*) next())) { - h->Print(option); - } - } + TIter next(fHists); + while (auto h = next()) + h->Print(option); } ////////////////////////////////////////////////////////////////////////////////