diff util/queue.lua @ 13956:f50a9746fec0

util.queue: Convenience functions for empty/full
author Matthew Wild <mwild1@gmail.com>
date Thu, 25 Sep 2025 16:54:23 +0100
parents d10957394a3c
children
line wrap: on
line diff
--- a/util/queue.lua	Thu Sep 25 16:53:35 2025 +0100
+++ b/util/queue.lua	Thu Sep 25 16:54:23 2025 +0100
@@ -21,6 +21,8 @@
 		_items = t;
 		size = size;
 		count = function (self) return items; end;
+		empty = function () return items == 0; end;
+		full = function () return items == size; end;
 		push = function (self, item)
 			if items >= size then
 				if allow_wrapping then