From 1feaf062ef04a231c9126f99a68eaa579fd0e390 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Mon, 1 May 2017 13:16:32 -0700 Subject: [PATCH] len function --- tinyqueue.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tinyqueue.go b/tinyqueue.go index 4cc2bb4..4a06258 100644 --- a/tinyqueue.go +++ b/tinyqueue.go @@ -46,7 +46,9 @@ func (q *Queue) Peek() Item { } return q.data[0] } - +func (q *Queue) Len() int { + return q.length +} func (q *Queue) down(pos int) { data := q.data halfLength := q.length >> 1