From 60fd405887fd28b7135587ac44460d99447c9db4 Mon Sep 17 00:00:00 2001 From: Kyle Maxwell Date: Sun, 29 May 2011 14:56:32 -0700 Subject: [PATCH] fix bug in limited walks --- lib/fraggle/client.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fraggle/client.rb b/lib/fraggle/client.rb index 76b9265..664e111 100644 --- a/lib/fraggle/client.rb +++ b/lib/fraggle/client.rb @@ -121,8 +121,10 @@ def walk(rev, path, off=0, lim=MaxInt64, ents=[], &blk) end def all(m, rev, path, off, lim, ents=[], &blk) + # We're decrementing lim as we go, so we need to return + # the accumulated values if lim == 0 - cn.next_tick { blk.call([], nil) } + cn.next_tick { blk.call(ents, nil) } return end