Update documentation on xmltree.items/mitems (#11930)

* Update documentation on `xmltree.items`/`mitems`

So far the documentation on `items` and `mitems` wasn't explicit about whether the iteration recurses down the node's children or not. I assumed recursion, which was wrong.

* Improve wording in comment

Use the more common and shorter word "direct".

(cherry picked from commit c9c28bf85e)
This commit is contained in:
sschwarzer
2019-08-12 11:12:22 +02:00
committed by narimiran
parent 2874cfa207
commit 3a064ee3c0

View File

@@ -392,7 +392,7 @@ proc clear*(n: var XmlNode) =
iterator items*(n: XmlNode): XmlNode {.inline.} =
## Iterates over any child of `n`.
## Iterates over all direct children of `n`.
##
## **Examples:**
##
@@ -417,7 +417,7 @@ iterator items*(n: XmlNode): XmlNode {.inline.} =
for i in 0 .. n.len-1: yield n[i]
iterator mitems*(n: var XmlNode): var XmlNode {.inline.} =
## Iterates over any child of `n` so that it can be modified.
## Iterates over all direct children of `n` so that they can be modified.
assert n.k == xnElement
for i in 0 .. n.len-1: yield n[i]