Bugfix: find verb should check for ID match

because otherwise we'd need to send a whole subtree
over the wire and then descend into it just to find an element.

This too is a ripple effect of making '==' deep
This commit is contained in:
Fischlurch 2015-11-01 23:11:55 +01:00
parent 34d79ee8df
commit 4a3b077824
2 changed files with 6 additions and 4 deletions

View file

@ -233,7 +233,12 @@ namespace diff{
{
Iter end_of_scope = src().currIsAttrib()? src().attribs.end()
: src().children.end();
return std::find (srcPos(), end_of_scope, elm);
return std::find_if (srcPos()
,end_of_scope
,[&](auto& entry)
{
return entry.matches(elm);
});
}
GenNode const&

View file

@ -2008,9 +2008,6 @@
</node>
<node CREATED="1446356556349" ID="ID_1068649765" MODIFIED="1446356607845" TEXT="offen...">
<icon BUILTIN="flag-yellow"/>
<node CREATED="1446356564244" ID="ID_211629813" MODIFIED="1446356584315" TEXT="find nicht per == sondern per match">
<icon BUILTIN="messagebox_warning"/>
</node>
<node CREATED="1446356765393" ID="ID_293921295" MODIFIED="1446356827238" TEXT="IDs in Testdaten f&#xfc;r GenNodeBaisc_test">
<richcontent TYPE="NOTE"><html>
<head>