From 80beeeb187e84bda89cfe7390704f6a53406cad6 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 29 Sep 2020 21:27:16 -0500 Subject: util.indexedbheap: Fix heap datastructure corruption in :reschedule(smaller_value) --- util/indexedbheap.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/indexedbheap.lua b/util/indexedbheap.lua index 7f193d54..45830673 100644 --- a/util/indexedbheap.lua +++ b/util/indexedbheap.lua @@ -23,7 +23,7 @@ local function _percolate_up(self, k, sync, index) local tmp_sync = sync[k]; while k ~= 1 do local parent = math_floor(k/2); - if tmp < self[parent] then break; end + if tmp >= self[parent] then break; end self[k] = self[parent]; sync[k] = sync[parent]; index[sync[k]] = k; -- cgit v1.2.3