summaryrefslogtreecommitdiffstats
path: root/src/concurrent
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-05-28 12:23:55 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-05-28 15:12:16 +0200
commitb6a2962a52db4f1d704e4ff68cede40ec13df60c (patch)
treeb38e3e52a5e0928ce8be3e979715263bade2eef1 /src/concurrent
parentb37cf68810f01364297d2bc15643a32f23fca5f5 (diff)
Make some members of IterateKernel const
Change-Id: Ifeabebcbb7212a8c2799a37665b290983fd64105 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/concurrent')
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.h11
1 files 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<T>(pool), begin(_begin), end(_end), current(_begin), currentIndex(0),
- forIteration(selectIteration(typename std::iterator_traits<Iterator>::iterator_category())), progressReportingEnabled(true)
+ : ThreadEngine<T>(pool), begin(_begin), end(_end), current(_begin), currentIndex(0)
+ , forIteration(selectIteration(typename std::iterator_traits<Iterator>::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;