Bug 354666 - new check: Find cases of QSet::intersected().isEmpty()
Summary: new check: Find cases of QSet::intersected().isEmpty()
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-01 01:37 UTC by Sergio Martins
Modified: 2015-12-06 12:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Martins 2015-11-01 01:37:53 UTC
!QSet::intersects() is much much faster
Comment 1 Sergio Martins 2015-12-06 12:32:52 UTC
Git commit f88cee2a4193b8250e9745f1ce22192d225251c7 by Sergio Martins.
Committed on 06/12/2015 at 12:28.
Pushed by smartins into branch 'master'.

Introduce qset-intersects check

QSet::intersects() is much faster than QSet::interect().isEmpty().
The later allocates memory and does a full iteration.
The former bails our early and doesn't allocate.

This check is hidden while Qt 5.6 isn't released.

M  +1    -0    CMakeLists.txt
A  +7    -0    checks/README-qset-intersects
A  +70   -0    checks/qset-intersects.cpp     [License: GPL (v2+) (+Qt exception)]
A  +47   -0    checks/qset-intersects.h     [License: GPL (v2+) (+Qt exception)]
M  +11   -11   tests/clazy/test_requested_checks.sh.expected
A  +8    -0    tests/qset-intersects/config.json
A  +8    -0    tests/qset-intersects/main.cpp     [License: UNKNOWN]  *
A  +1    -0    tests/qset-intersects/main.cpp.expected

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/clazy/f88cee2a4193b8250e9745f1ce22192d225251c7