Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Reimers, Dominik
fpinjava
Commits
674e189a
Commit
674e189a
authored
Feb 23, 2017
by
pysaumont
Browse files
Fixed List.take
parent
4a15eba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
fpinjava-parent/fpinjava-common/src/main/java/com/fpinjava/common/List.java
View file @
674e189a
...
...
@@ -691,9 +691,9 @@ public abstract class List<A> {
protected
List
<
A
>
take
(
int
n
)
{
return
this
.
isEmpty
()
?
this
:
n
>
1
:
n
>
0
?
new
Cons
<>(
head
(),
tail
().
take
(
n
-
1
))
:
new
Cons
<>(
head
(),
list
()
)
;
:
list
();
}
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment