Warning, /sdk/clazy/docs/checks/README-qdeleteall.md is written in an unsupported language. File is not indexed.

0001 # qdeleteall
0002 Finds places where a call to `qDeleteAll()` has a redundant `values()` or `keys()` call.
0003 Those calls create a temporary `QList<int>` and allocate memory.
0004 
0005 #### Example
0006 
0007     QSet<Cookies> set;
0008 
0009     // BAD: Unneeded container iteration and memory allocation to construct list of values
0010     qDeleteAll(set.values());
0011 
0012     // GOOD: Unneeded container iteration and memory allocation to construct list of values
0013     qDeleteAll(set);
0014 
0015 #### Pitfalls
0016 
0017 Very rarely you might be deleting a list of `QObject`s who's `destroyed()` signal is connected to some code
0018 that modifies the original container. In the case of this contrived example iterating over the container copy is safer.