Code

optimization: do not notify any listeners if attributes' new value is the same as old
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 13 Feb 2006 01:54:33 +0000 (01:54 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 13 Feb 2006 01:54:33 +0000 (01:54 +0000)
src/xml/simple-node.cpp

index fa626a3f2d19e5e640e46da86fec7f85d9854268..d83e5d54bac2cc72519392543fa5282a75bc876b 100644 (file)
@@ -429,7 +429,7 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const is_in
         }
     }
 
-    if ( new_value != old_value ) {
+    if ( new_value != old_value && (!old_value || !new_value || strcmp(old_value, new_value))) {
         if (_logger) {
             _logger->notifyAttributeChanged(*this, key, old_value, new_value);
         }