diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-11-16 21:58:53 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-11-16 22:11:46 +0000 |
commit | eaba657d90c896e45fbd2ab24276b7cc86ec5653 (patch) | |
tree | 9d195e2ae8744bbabdc6f2171feec132ba20dc69 /src/plugins/python/pythonutils.cpp | |
parent | 27c962f50301a95823f4bfe13657419779d4cb93 (diff) | |
download | qt-creator-eaba657d90c896e45fbd2ab24276b7cc86ec5653.tar.gz |
Fix warnings about possible detach of temporary objects
Calling first() or last() on temporary container may
unnecessarily detach the container. Fix it by calling
constFirst() and constLast().
Change-Id: I2460efd5dbee1534eec8a514d9bff2a947bfddf9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
-rw-r--r-- | src/plugins/python/pythonutils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index bd28d749b7..e08debf860 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -197,7 +197,7 @@ static FilePath detectPython(const FilePath &documentPath) python = PythonSettings::defaultInterpreter().command; if (!python.exists() && !PythonSettings::interpreters().isEmpty()) - python = PythonSettings::interpreters().first().command; + python = PythonSettings::interpreters().constFirst().command; return python; } |