diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-12-07 19:31:39 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-12-08 10:21:57 +0000 |
commit | c021fb5179eae952e1d46509536f6096e4fb165e (patch) | |
tree | a3ad94c16fc7b9bb1bf08106b1cb389999d975ae /src/plugins/python/pythonlanguageclient.cpp | |
parent | 8e7e1dd5f2e3d0179b9b49c2914a87b09006a12c (diff) | |
download | qt-creator-c021fb5179eae952e1d46509536f6096e4fb165e.tar.gz |
Don't call non-const methods on temporary QList
Otherwise it may unnecessarily detach. Either store a local
const reference or call const equivalent (e.g. constFirst()).
Change-Id: I96d665487cf28c17e72bea17f1b8f164ce06cc70
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
-rw-r--r-- | src/plugins/python/pythonlanguageclient.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index ce8d254ba7..f4b6a0d52f 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -268,7 +268,7 @@ void PyLSClient::updateExtraCompilerContents(ExtraCompiler *compiler, const File void PyLSClient::closeExtraCompiler(ProjectExplorer::ExtraCompiler *compiler) { - const FilePath file = compiler->targets().first(); + const FilePath file = compiler->targets().constFirst(); m_extraCompilerOutputDir.pathAppended(file.fileName()).removeFile(); compiler->disconnect(this); } |