@@ -1235,6 +1235,26 @@ pcmk__xml_escape(const char *text, enum pcmk__xml_escape_type type)
12351235 return g_string_free (copy , FALSE);
12361236}
12371237
1238+ /*!
1239+ * \internal
1240+ * \brief Set the \c pcmk__xf_created flag on an attribute
1241+ *
1242+ * \param[in,out] attr XML attribute
1243+ * \param[in] user_data Ignored
1244+ *
1245+ * \return \c true (to continue iterating)
1246+ *
1247+ * \note This is compatible with \c pcmk__xe_foreach_attr().
1248+ */
1249+ static bool
1250+ mark_attr_created (xmlAttr * attr , void * user_data )
1251+ {
1252+ xml_node_private_t * nodepriv = attr -> _private ;
1253+
1254+ pcmk__set_xml_flags (nodepriv , pcmk__xf_created );
1255+ return true;
1256+ }
1257+
12381258/*!
12391259 * \internal
12401260 * \brief Add an XML attribute to a node, marked as deleted
@@ -1449,12 +1469,7 @@ static void
14491469xml_diff_attrs (xmlNode * old_xml , xmlNode * new_xml )
14501470{
14511471 // Cleared later if attributes are not really new
1452- for (xmlAttr * attr = pcmk__xe_first_attr (new_xml ); attr != NULL ;
1453- attr = attr -> next ) {
1454- xml_node_private_t * nodepriv = attr -> _private ;
1455-
1456- pcmk__set_xml_flags (nodepriv , pcmk__xf_created );
1457- }
1472+ pcmk__xe_foreach_attr (new_xml , mark_attr_created , NULL );
14581473
14591474 pcmk__xe_foreach_attr (old_xml , mark_attr_diff , new_xml );
14601475 pcmk__xe_foreach_attr (new_xml , check_new_attr_acls , NULL );
0 commit comments