Skip to content

Commit 2b24867

Browse files
author
Javier de Silóniz Sandino
committed
Fixed minor issue
1 parent e2ef0aa commit 2b24867

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/fpinscalalib/StrictnessAndLazinessSection.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ object StrictnessAndLazinessSection extends FlatSpec with Matchers with org.scal
7676
* if2(false, sys.error("fail"), 3)
7777
* }}}
7878
*
79-
* With either syntax, an argument that’s passed unevaluated to a function will be evalu- ated once for each place
79+
* With either syntax, an argument that’s passed unevaluated to a function will be evaluated once for each place
8080
* it’s referenced in the body of the function. That is, Scala won’t (by default) cache the result of evaluating an
8181
* argument:
8282
*
@@ -450,7 +450,7 @@ object StrictnessAndLazinessSection extends FlatSpec with Matchers with org.scal
450450
def takeViaUnfold[A](s: Stream[A], n: Int): Stream[A] =
451451
unfold((s, n)) {
452452
case (Cons(h,t), 1) => Some((h(), (Stream.empty, res0)))
453-
case (Cons(h,t), n) if n > 1 => Some((h(), (t(), n - 1)))
453+
case (Cons(h,t), n) if n > 1 => Some((h(), (t(), n - res1)))
454454
case _ => None
455455
}
456456

0 commit comments

Comments
 (0)