GitHub user FSchumacher opened a pull request:
https://github.com/apache/jmeter/pull/402
Use isEmpty instead of comparing size of a collection to zero
## Description
Use `isEmpty()` on collections instead of comparing their size to zero
## Motivation and Context
The `isEmpty()` check can be done a lot faster than calculating the size of
a collection. This is mainly a performance optimiziation, but it does make the
intention of the code a bit clearer, too.
## How Has This Been Tested?
No functional change has been done, so the normal test suite should catch
any unintended changes.
## Screenshots (if appropriate):
## Types of changes
- make code a bit clearer and perhaps a bit faster
## Checklist:
- [x] My code follows the [code style][style-guide] of this project.
[style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/FSchumacher/jmeter use-isempty-insteadof-size
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jmeter/pull/402.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #402
commit 32d125eabfc5f926a4d364cd7641b60899902305
Author: Felix Schumacher
Date: 2018-10-06T13:11:26Z
Use isEmpty instead of comparing size of a collection to zero
---