diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-12-04 11:52:12 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-12-07 09:56:53 +0000 |
commit | 88b9e4e3ba5e5a72d7c614126c853de2a55af1a0 (patch) | |
tree | 9da8302df5696f20061a6078816e72f0ba563699 /src/lib/corelib/buildgraph/nodeset.h | |
parent | 281f8519f4bde3dcf59c23fa9c7e1b2739506c74 (diff) |
Get rid of all remaining dynamic_casts
This speeds up rule execution by another 2%.
Change-Id: If819144f2c01bd243ec98f7a6d050bc5faa2b02c
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/nodeset.h')
-rw-r--r-- | src/lib/corelib/buildgraph/nodeset.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/nodeset.h b/src/lib/corelib/buildgraph/nodeset.h index 1fde2b40b..961a4bcc3 100644 --- a/src/lib/corelib/buildgraph/nodeset.h +++ b/src/lib/corelib/buildgraph/nodeset.h @@ -79,7 +79,7 @@ public: const_iterator(const NodeSet &nodes, const NodeSet::const_iterator &it) : m_nodes(nodes), m_it(it) { - while (m_it != m_nodes.constEnd() && dynamic_cast<T *>(*m_it) == 0) + while (m_it != m_nodes.constEnd() && !hasDynamicType<T>(*m_it)) ++m_it; } @@ -97,7 +97,7 @@ public: { for (;;) { ++m_it; - if (m_it == m_nodes.constEnd() || dynamic_cast<T *>(*m_it)) + if (m_it == m_nodes.constEnd() || hasDynamicType<T>(*m_it)) return *this; } } |