diff --git a/src/lib/diff/record-content-mutator.hpp b/src/lib/diff/record-content-mutator.hpp index e0b93d109..892a3253e 100644 --- a/src/lib/diff/record-content-mutator.hpp +++ b/src/lib/diff/record-content-mutator.hpp @@ -30,7 +30,10 @@ ** details of doing so are highly coupled to the actual storage implementation ** of #Record, as well as to the actual procedure to apply a diff message, as ** implemented in lib::diff::DiffApplicationStrategy. - ** + ** @warning this struct is marked "internal" for a reason; + ** it serves the purpose to remove technicalities from usage site, + ** yet it is \em not a proper abstraction. Be sure you understand + ** the storage layout, especially when testing for iteration end. ** @see generic-record-update-test.cpp ** @see tree-diff-application-test.cpp ** @see Record::Mutator @@ -115,6 +118,15 @@ namespace diff{ void resetPos() + { + if (attribs.empty()) + jumpToChildScope(); + else + jumpToAttribScope(); + } + + void + jumpToAttribScope() { pos = attribs.begin(); } diff --git a/src/lib/diff/tree-diff-application.hpp b/src/lib/diff/tree-diff-application.hpp index 5bc0d8912..119ed506c 100644 --- a/src/lib/diff/tree-diff-application.hpp +++ b/src/lib/diff/tree-diff-application.hpp @@ -108,6 +108,7 @@ namespace diff{ void init() { target.swapContent (content); + content.resetPos(); } };