diff options
Diffstat (limited to 'docs/checks/README-isempty-vs-count.md')
-rw-r--r-- | docs/checks/README-isempty-vs-count.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/checks/README-isempty-vs-count.md b/docs/checks/README-isempty-vs-count.md new file mode 100644 index 00000000..4db9a33f --- /dev/null +++ b/docs/checks/README-isempty-vs-count.md @@ -0,0 +1,11 @@ +# isempty-vs-count + +Finds places where you're using `Container::count()` or `Container::size()` instead of `Container::isEmpty()`. +Although there's no performance benefit, `isEmpty()` provides better semantics. + +#### Example +``` +QList<int> foo; +... +if (foo.count()) {} +``` |