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

Validation own #72

Merged
merged 15 commits into from
Aug 12, 2019
Merged

Validation own #72

merged 15 commits into from
Aug 12, 2019

Conversation

Felipe444
Copy link
Collaborator

No description provided.

if (array1 == null) {
return array2 == null;
}
if (array2 == null) {
return false;
}

return Arrays.equals(array1, array2);
int len = array1.length;
Copy link
Contributor

Choose a reason for hiding this comment

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

it can be done like this:

return array1.length == array2.length && IntStream.range(0, array1.length)
            .allMatch(i -> checker.test(array1[i], array2[i]));

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@Felipe444 Felipe444 self-assigned this Aug 12, 2019
@Felipe444 Felipe444 merged commit 3f9a315 into master Aug 12, 2019
@Felipe444 Felipe444 deleted the validation-own branch August 12, 2019 08:50
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.

6 participants