Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use preferred isEmpty checks #568

Merged
merged 1 commit into from
Aug 23, 2021
Merged

Conversation

michalsrutek
Copy link
Contributor

What and why?

Use preferred way of checking emptiness with Collection's isEmpty property, as it has a complexity of O(1).

How?

By replacing .count == 0 checks with .isEmpty.

@michalsrutek michalsrutek requested a review from a team as a code owner August 20, 2021 09:38
@ncreated ncreated self-assigned this Aug 23, 2021
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @michalsrutek , it looks good 🙂 👍

@ncreated ncreated merged commit 91ec2db into DataDog:master Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants