From aa61a592fc35611776c52c35d9c41c15e4e9fd0d Mon Sep 17 00:00:00 2001 From: Daniel Cannon Date: Tue, 14 Apr 2015 19:11:26 +0100 Subject: [PATCH] Fix bug with queue data structure --- cursor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cursor.go b/cursor.go index 35d5b30d..7629a92c 100644 --- a/cursor.go +++ b/cursor.go @@ -412,6 +412,10 @@ type queue struct { } func (q *queue) Len() int { + if len(q.elems) == 0 { + return 0 + } + return q.nelems } func (q *queue) Push(elem interface{}) {