https://bugs.kde.org/show_bug.cgi?id=360374

            Bug ID: 360374
           Summary: Check for QString::left(1) mis-use.
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: unassigned-b...@kde.org
          Reporter: vkra...@kde.org
                CC: smart...@kde.org

QString::left(1) is an inefficient way of saying QString::at(0) in most cases.

A quick grep over Qt and KDE sources show basically two use-cases (about 40-50
hits):
* str.left(1) == QStringLiteral("#") 
* str.left(1).toUpper() - typically used as part of string concatenations
Both cases would work with at(0) just as well, and at least the latter one
isn't caught yet by clazy.

Reproducible: Always

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to