From 77618b3511ee5edb6509902126293a084f9767bf Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Fri, 27 Nov 2015 11:02:12 +0100 Subject: Angleset: Change add behaviour to not run combine() The most often used command for angleset in this tool is the add function. If at the end of every add the combine() function is being called, a lot of CPU time is wasted. Add now doesn't call combine(), and marks the angleset as dirty instead. All functions that require a clean angleset now check if it's dirty, and if yes call combine(). --- anglerange.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'anglerange.cpp') diff --git a/anglerange.cpp b/anglerange.cpp index c62f760..99e6718 100644 --- a/anglerange.cpp +++ b/anglerange.cpp @@ -144,7 +144,7 @@ bool anglerange::isinside(const angleclass &val) const } } -anglerange anglerange::overlap(const anglerange &other) +anglerange anglerange::overlap(const anglerange &other) const { //storage for the return value: anglerange retval; //anglerange constructor without arguments: emtpy range [0:0] @@ -239,7 +239,7 @@ anglerange anglerange::overlap(const anglerange &other) return(retval); } -anglerange anglerange::combine(const anglerange &other) +anglerange anglerange::combine(const anglerange &other) const { anglerange retval; retval.setsorttype(sortby); //return value inherits current sorttype. -- cgit v1.2.3