Skip to content

Commit c97a714

Browse files
committed
Fixed the memoize demo
1 parent f12777e commit c97a714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/groovy/groovyx/gpars/samples/memoize/DemoFibonacciMemoize.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import groovyx.gpars.GParsPool
2828

2929
GParsPool.withPool {
3030
Closure fib
31-
fib = {n -> n > 1 ? fib(n - 2) + fib(n - 1) : n}.memoizeAtMost(2) //try to remove the gmemoize() method call to get the original slow exponential complexity behavior
31+
fib = {n -> n > 1 ? fib(n - 2) + fib(n - 1) : n}.gmemoizeAtMost(2) //try to remove the gmemoize() method call to get the original slow exponential complexity behavior
3232
println "Fib for 0: ${fib(0)}"
3333
println "Fib for 1: ${fib(1)}"
3434
println "Fib for 2: ${fib(2)}"

0 commit comments

Comments
 (0)