Warning, /sdk/clazy/docs/checks/README-qstring-insensitive-allocation.md is written in an unsupported language. File is not indexed.
0001 # qstring-insensitive-allocation 0002 0003 Finds unneeded memory allocations such as 0004 `if (str.toLower().contains("foo"))` which you should fix as 0005 `if (str.contains("foo", Qt::CaseInsensitive))` to avoid the heap allocation caused by toLower(). 0006 0007 Matches any of the following cases: 0008 `str.{toLower, toUpper}().{contains, compare, startsWith, endsWith}()` 0009 0010 #### Pitfalls 0011 `Qt::CaseInsensitive` is different from `QString::toLower()` comparison for a few code points, but it 0012 should be very rare: <http://lists.qt-project.org/pipermail/development/2016-February/024776.html>