Skip to content

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

@dgroup

Description

@dgroup

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 {
       ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions