Fixed Container::splice() method trimming the last element even when not supposed to

Sat, 23 Jul 2016 12:23:07 +0300

author
Teemu Piippo <teemu@compsta2.com>
date
Sat, 23 Jul 2016 12:23:07 +0300
changeset 164
e3794f48a589
parent 163
5948441a1951
child 165
718a8c4df538
child 168
96ffd13c08a2

Fixed Container::splice() method trimming the last element even when not supposed to

sources/list.h file | annotate | diff | comparison | revisions
--- a/sources/list.h	Sat Jul 23 12:22:23 2016 +0300
+++ b/sources/list.h	Sat Jul 23 12:23:07 2016 +0300
@@ -270,8 +270,8 @@
 
 	Self splice(int start, int end, int step = 1) const
 	{
-		start = clamp(start, 0, size() - 1);
-		end = clamp(end, 0, size() - 1);
+		start = clamp(start, 0, size());
+		end = clamp(end, 0, size());
 
 		if (end <= start)
 		{

mercurial