changeProperty(): don't change the property if the value would not change, this should save some procecssing..

Sat, 19 Oct 2013 02:33:08 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sat, 19 Oct 2013 02:33:08 +0300
changeset 521
b85554206155
parent 520
37d5da2f188e
child 522
afa691788bdb

changeProperty(): don't change the property if the value would not change, this should save some procecssing..

src/ldtypes.cpp file | annotate | diff | comparison | revisions
--- a/src/ldtypes.cpp	Sat Oct 19 01:22:11 2013 +0300
+++ b/src/ldtypes.cpp	Sat Oct 19 02:33:08 2013 +0300
@@ -667,6 +667,9 @@
 template<class T> static void changeProperty (LDObject* obj, T* ptr, const T& val)
 {	long idx;
 
+	if (*ptr == val)
+		return;
+
 	if (obj->file() && (idx = obj->getIndex()) != -1)
 	{	str before = obj->raw();
 		*ptr = val;

mercurial