Opened 10 years ago
Last modified 10 years ago
#12983 confirmed New Feature
Walker.guard is called more than once for every node boundary
Reported by: | Piotrek Koszuliński | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description (last modified by )
Discovered when working on #12964.
See tests pushed in branch:t/12983.
It would be useful if we knew that guard will be called only once, because it makes some iterations easier (and guard is the only callback which is called for both element boundaries).
Change History (2)
comment:1 Changed 10 years ago by
Status: | new → confirmed |
---|---|
Type: | Bug → Task |
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Type: | Task → New Feature |
I made an attempt to change this behaviour, but it looks that walker wasn't designed with this constraint in mind. I tracked some issues in the code of the
iterate()
function which does not seem to care about how many times the guard function is called. Therefore, I had to abandon the idea of changing this behaviour.PS. Not only walker would need to be changed, but also node.getNext/PreviousSourceNode which also accepts guard and is used by the walker. It also had some odd behaviours like calling guard on itself even though it was called with the startFromSibling param.