summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/cycledetector.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-04-12 09:43:06 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2013-04-12 15:10:46 +0200
commit6c64c84c7fd22f82d4ed423d57889a65e72097b8 (patch)
treeddd050777c8053546e7a73087991c118dacd1ca6 /src/lib/buildgraph/cycledetector.cpp
parent88fdf28c0d499f6dea6193072e796c313e61c2b3 (diff)
downloadqbs-6c64c84c7fd22f82d4ed423d57889a65e72097b8.tar.gz
Help compiler with branch prediction.
Mark error checks in potentially performance-sensitive contexts with Q_UNLIKELY. Actual benefits unknown, but it cannot hurt. Change-Id: If3d2375965e6342b5d7a0b46ad2c8a41fd3567d0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/cycledetector.cpp')
-rw-r--r--src/lib/buildgraph/cycledetector.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/buildgraph/cycledetector.cpp b/src/lib/buildgraph/cycledetector.cpp
index 1e9dcdb9d..3e39b70c9 100644
--- a/src/lib/buildgraph/cycledetector.cpp
+++ b/src/lib/buildgraph/cycledetector.cpp
@@ -53,7 +53,7 @@ void CycleDetector::visitProject(const ResolvedProjectConstPtr &project)
void CycleDetector::visitArtifact(Artifact *artifact)
{
- if (m_artifactsInCurrentPath.contains(artifact)) {
+ if (Q_UNLIKELY(m_artifactsInCurrentPath.contains(artifact))) {
Error error(Tr::tr("Cycle in build graph detected."));
foreach (const Artifact * const a, cycle(artifact))
error.append(a->filePath());