Changeset

9105:e735c9865f42

mod_storage_internal: Only apply truncate if there are more items than requested
author Kim Alvefur <zash@zash.se>
date Sat, 04 Aug 2018 15:44:38 +0200
parents 9104:e1ca373a7e09
children 9106:e70b9e8bc443
files plugins/mod_storage_internal.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_internal.lua	Sat Aug 04 12:00:46 2018 +0100
+++ b/plugins/mod_storage_internal.lua	Sat Aug 04 15:44:38 2018 +0200
@@ -191,7 +191,7 @@
 				return item.when > query["end"];
 			end);
 		end
-		if query.truncate then
+		if query.truncate and #items > query.truncate then
 			if query.reverse then
 				-- Before: { 1, 2, 3, 4, 5, }
 				-- After: { 1, 2, 3 }