* xmlXPathNodeSetRemove: * @cur: the initial node set * @val: the index to remove * * Removes an entry from an existing NodeSet list. */
| 3274 | * Removes an entry from an existing NodeSet list. |
| 3275 | */ |
| 3276 | void |
| 3277 | xmlXPathNodeSetRemove(xmlNodeSetPtr cur, int val) { |
| 3278 | if (cur == NULL) return; |
| 3279 | if (val >= cur->nodeNr) return; |
| 3280 | if ((cur->nodeTab[val] != NULL) && |
| 3281 | (cur->nodeTab[val]->type == XML_NAMESPACE_DECL)) |
| 3282 | xmlXPathNodeSetFreeNs((xmlNsPtr) cur->nodeTab[val]); |
| 3283 | cur->nodeNr--; |
| 3284 | for (;val < cur->nodeNr;val++) |
| 3285 | cur->nodeTab[val] = cur->nodeTab[val + 1]; |
| 3286 | cur->nodeTab[cur->nodeNr] = NULL; |
| 3287 | } |
| 3288 | |
| 3289 | /** |
| 3290 | * xmlXPathFreeNodeSet: |
nothing calls this directly
no test coverage detected