Warning, /sdk/clazy/docs/checks/README-qstring-left.md is written in an unsupported language. File is not indexed.
0001 # qstring-left 0002 0003 Finds places where you're using `QString::left(1)` instead of `QString::at(0)`. 0004 The later form is cheaper, as it doesn't deep-copy the string. 0005 0006 There's however another difference between the two: `left(1)` will return an empty 0007 string if the string is empty, while `QString::at(0)` will assert. So be sure 0008 that the string can't be empty, or add a `if (!str.isEmpty()` guard, which is still 0009 faster than calling `left()` for the cases which deep-copy.