[clazy] [Bug 377617] New: clazy-qstring-left makes false assumption
bugzilla_noreply at kde.org
bugzilla_noreply at kde.org
Tue Mar 14 15:16:47 GMT 2017
https://bugs.kde.org/show_bug.cgi?id=377617
Bug ID: 377617
Summary: clazy-qstring-left makes false assumption
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: markus.enzenberger at gmail.com
CC: smartins at kde.org
Target Milestone: ---
The clazy-qstring-left warning makes the false assumption that QString::left(1)
can be replaced by the more efficient QString::at(0). This is not true in
general.
It is illegal to call QString::at() with an invalid position, but
QString::left() may be called with an empty string (in which case it also
returns an empty string).
There could exist code, which relies on this and uses QString::left(1) to avoid
handling the extra case in the calling code.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list