mirror of
https://github.com/zeux/pugixml.git
synced 2025-01-14 01:47:55 +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:
parent
dfb2b7f7b4
commit
58616a29aa
@ -3503,12 +3503,13 @@ PUGI_IMPL_NS_BEGIN
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
xml_node_struct* prev_cursor = cursor;
|
||||||
PUGI_IMPL_PUSHNODE(node_pcdata); // Append a new node on the tree.
|
PUGI_IMPL_PUSHNODE(node_pcdata); // Append a new node on the tree.
|
||||||
|
|
||||||
cursor->value = parsed_pcdata; // Save the offset.
|
cursor->value = parsed_pcdata; // Save the offset.
|
||||||
merged = parsed_pcdata; // Used for parse_merge_pcdata above, cheaper to save unconditionally
|
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;
|
if (!*s) break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user