0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-26 21:04:25 +08:00

Avoid store-load penalty on cursor->parent

This reclaims the performance lost in PCDATA reorganization and gains a
little more on top of that.
This commit is contained in:
Arseny Kapoulkine 2023-09-05 22:23:31 -07:00
parent dfb2b7f7b4
commit 58616a29aa

View File

@ -3503,12 +3503,13 @@ PUGI_IMPL_NS_BEGIN
}
else
{
xml_node_struct* prev_cursor = cursor;
PUGI_IMPL_PUSHNODE(node_pcdata); // Append a new node on the tree.
cursor->value = parsed_pcdata; // Save the offset.
merged = parsed_pcdata; // Used for parse_merge_pcdata above, cheaper to save unconditionally
PUGI_IMPL_POPNODE(); // Pop since this is a standalone.
cursor = prev_cursor; // Pop since this is a standalone.
}
if (!*s) break;