File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,21 +166,13 @@ static int rapidxml_BaseObject_setvalue(rapidxml_BaseObject* self,
166166 char * new_value = self->document ->allocate_string (static_cast <const char *>(value.buf ));
167167 self->underlying_obj ->value (new_value);
168168 if (IS_NODE (reinterpret_cast <PyObject*>(self))) {
169- rapidxml::xml_node<>* node =
170- static_cast <rapidxml::xml_node<>*>(self->underlying_obj );
169+ rapidxml::xml_node<>* node = static_cast <rapidxml::xml_node<>*>(self->underlying_obj );
171170 if (node->type () == rapidxml::node_element) {
172- /*
173- ** When the document is parsed with data nodes (parse_cdata=True),
174- ** the element value is held by data/cdata children, which take
175- ** precedence over the element value when printing.
176- ** Keep them in sync: update the first one, drop the others.
177- */
178171 rapidxml::xml_node<>* child = node->first_node ();
179172 bool found = false ;
180- while (child != NULL ) {
173+ while (child) {
181174 rapidxml::xml_node<>* next = child->next_sibling ();
182- if (child->type () == rapidxml::node_data ||
183- child->type () == rapidxml::node_cdata) {
175+ if (child->type () == rapidxml::node_data || child->type () == rapidxml::node_cdata) {
184176 if (!found) {
185177 child->value (new_value);
186178 found = true ;
You can’t perform that action at this time.
0 commit comments