From b6a2962a52db4f1d704e4ff68cede40ec13df60c Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 28 May 2020 12:23:55 +0200 Subject: [PATCH] Make some members of IterateKernel const Change-Id: Ifeabebcbb7212a8c2799a37665b290983fd64105 Reviewed-by: Sona Kurazyan --- src/concurrent/qtconcurrentiteratekernel.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index efe679ccf2..6ea96f5097 100644 --- a/src/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -159,10 +159,11 @@ public: typedef T ResultType; IterateKernel(QThreadPool *pool, Iterator _begin, Iterator _end) - : ThreadEngine(pool), begin(_begin), end(_end), current(_begin), currentIndex(0), - forIteration(selectIteration(typename std::iterator_traits::iterator_category())), progressReportingEnabled(true) + : ThreadEngine(pool), begin(_begin), end(_end), current(_begin), currentIndex(0) + , forIteration(selectIteration(typename std::iterator_traits::iterator_category())) + , iterationCount(forIteration ? std::distance(_begin, _end) : 0) + , progressReportingEnabled(true) { - iterationCount = forIteration ? std::distance(_begin, _end) : 0; } virtual ~IterateKernel() { } @@ -288,9 +289,9 @@ public: const Iterator end; Iterator current; QAtomicInt currentIndex; - bool forIteration; + const bool forIteration; QAtomicInt iteratorThreads; - int iterationCount; + const int iterationCount; bool progressReportingEnabled; QAtomicInt completed;