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

Refactoring .after(Predicate<X> prd, long size) #61

Open
dgroup opened this issue May 8, 2021 · 1 comment
Open

Refactoring .after(Predicate<X> prd, long size) #61

dgroup opened this issue May 8, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@dgroup
Copy link
Owner

dgroup commented May 8, 2021

Actual result:

default Enumerable<X> after(Predicate<X> prd, long size) {
    final Enumerable<X> out;
    if (size < 0) {
        throw new IllegalArgumentException(Long.toString(size));
    } else if (size == 0) {
        out = new Empty<>();
    } else if (prd == null) {
        out = new Linked<>(this.stream().limit(size).collect(Collectors.toList()));
    } else {
        ...

Expected result:

default Enumerable<X> after(Predicate<X> prd, long size) {
    final Enumerable<X> out;
    if (size < 0) {
        throw new IllegalArgumentException(Long.toString(size));
    } else if (size == 0 || prd == null) {
        out = new Empty<>();
    } else {
       ...
@dgroup dgroup changed the title Refactoring Refactoring after(Predicate<X> prd, long size) May 8, 2021
@dgroup dgroup added the good first issue Good for newcomers label May 8, 2021
@dgroup dgroup changed the title Refactoring after(Predicate<X> prd, long size) Refactoring .after(Predicate<X> prd, long size) May 8, 2021
@dykov
Copy link
Contributor

dykov commented May 10, 2021

Done in #62
@dgroup , plese close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants