diff options
| author | hjk <hjk@qt.io> | 2025-11-12 16:51:34 +0100 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2025-11-13 09:42:00 +0000 |
| commit | 690ff4bacd922436bf308ea399d3f0ee80d42fcc (patch) | |
| tree | 8ae30efa372ad5b65ec261be110b9b1ebfe1b326 /src/plugins/python/pythonindenter.cpp | |
| parent | fadbd348a516f16b25863e2e04f14be2effda0a8 (diff) | |
Use QString::size() instead QString::length()
Minor gain in debug builds and when stepping.
Change-Id: I2540d309661e4babfd7331b068c17657ded2a098
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/python/pythonindenter.cpp')
| -rw-r--r-- | src/plugins/python/pythonindenter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/python/pythonindenter.cpp b/src/plugins/python/pythonindenter.cpp index b907d0f4531..92a2f70c0dc 100644 --- a/src/plugins/python/pythonindenter.cpp +++ b/src/plugins/python/pythonindenter.cpp @@ -91,7 +91,7 @@ bool PythonIndenter::isElectricLine(const QString &line) const return false; // trim spaces in 'if True: ' - int index = line.length() - 1; + int index = line.size() - 1; while (index > 0 && line[index].isSpace()) --index; @@ -105,7 +105,7 @@ int PythonIndenter::getIndentDiff(const QString &previousLine, static const QStringList jumpKeywords = { "return", "yield", "break", "continue", "raise", "pass" }; - Internal::Scanner sc(previousLine.constData(), previousLine.length()); + Internal::Scanner sc(previousLine.constData(), previousLine.size()); forever { Internal::FormatToken tk = sc.read(); if (tk.format() == Internal::Format_Keyword && jumpKeywords.contains(sc.value(tk))) |
