Commit graph

6 commits

Author SHA1 Message Date
LoneDev
d335f263f3
Fix comment typo in algorithm.h (#15030) 2021-05-29 11:30:47 +08:00
Chocobo1
d70b893852
Bump project requirement to C++17 2020-12-31 13:28:48 +08:00
Chocobo1
9c330812cc
Don't use deprecated QSet::iterator::operator+(int) 2020-06-04 20:20:50 +08:00
Chocobo1
c75500670d
Use forwarding reference when passing function objects
So instead of passing every function objects by value (a copy is made), now function objects
will be handled properly by reference (for lvalues) or by value (for rvalues).
2019-05-19 12:06:18 +08:00
Chocobo1
c6f3da1097
Improve removeIf() to support set types
We can now replace QMutable*Iterator by removeIf() which usage is more consistent with other
algorithm functions.
2019-05-14 01:26:01 +08:00
Luís Pereira
ac42ccb5e4
Don't create temporary containers just to iterate over them
Stops temporary containers being created needlessly due to API misuse.
For example, it’s common for developers to assume QHash::values() and
QHash::keys() are free and abuse them, failing to realize their
implementation internally actually iterates the whole container, allocates
memory, and fills a new QList.

Added a removeIf generic algorithm, similar to std ones. We can't use std
algorithms with Qt dictionaries because Qt iterators have different
behavior from the std ones.

Found using clazy.
2018-03-18 16:22:12 +03:00