# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1430782460 -7200
# Node ID cf15b18e981078452c7b51003a7fb73a4059c747
# Parent  0c363fddcdd9d25677f133157aa6cd400ea26a6c# Parent  99fa40d498cc05f5d3d5663c98377f215776aa89
Merge 0.10->trunk

diff -r 0c363fddcdd9 -r cf15b18e9810 util/events.lua
--- a/util/events.lua	Sun May 03 18:39:27 2015 +0200
+++ b/util/events.lua	Tue May 05 01:34:20 2015 +0200
@@ -9,6 +9,7 @@
 
 local pairs = pairs;
 local t_insert = table.insert;
+local t_remove = table.remove;
 local t_sort = table.sort;
 local setmetatable = setmetatable;
 local next = next;
@@ -118,7 +119,7 @@
 		if not w then return; end
 		for i = #w, 1 do
 			if w[i] == wrapper then
-				table.remove(w, i);
+				t_remove(w, i);
 			end
 		end
 		if #w == 0 then
diff -r 0c363fddcdd9 -r cf15b18e9810 util/statistics.lua
--- a/util/statistics.lua	Sun May 03 18:39:27 2015 +0200
+++ b/util/statistics.lua	Tue May 05 01:34:20 2015 +0200
@@ -88,7 +88,7 @@
 
 			return function (value)
 				n_actual_events = n_actual_events + 1;
-				if n_actual_events%duration_sample_interval > 0 then
+				if n_actual_events%duration_sample_interval == 1 then
 					last_event = (last_event%duration_max_samples) + 1;
 					events[last_event] = value;
 				end
@@ -113,7 +113,7 @@
 
 			return function ()
 				n_actual_events = n_actual_events + 1;
-				if n_actual_events%duration_sample_interval > 0 then
+				if n_actual_events%duration_sample_interval ~= 1 then
 					return nop_function;
 				end