summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-10-31 04:56:27 +0000
committerarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-10-31 04:56:27 +0000
commit973296bcb155a59b143ed5848771e7c5fed74c4d (patch)
tree8dc605d21df233df4bed29121fd67d66b01e0714 /src
parent09f9ab079e952853fe0f5ed61657f285a2fcd577 (diff)
Minor refactoring
git-svn-id: http://pugixml.googlecode.com/svn/trunk@923 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src')
-rw-r--r--src/pugixml.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 168ca0a..1422eb0 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -2616,9 +2616,6 @@ PUGI__NS_BEGIN
// allocator object is a part of document object
xml_allocator& alloc = *static_cast<xml_allocator*>(xmldoc);
- // store buffer for offset_debug
- if (xmldoc == root) xmldoc->buffer = buffer;
-
// early-out for empty documents
if (length == 0) return make_parse_result(status_ok);
@@ -3669,6 +3666,9 @@ PUGI__NS_BEGIN
// delete original buffer if we performed a conversion
if (own && buffer != contents && contents) impl::xml_memory::deallocate(contents);
+ // store buffer for offset_debug
+ doc->buffer = buffer;
+
// parse
xml_parse_result res = impl::xml_parser::parse(buffer, length, doc, root, options);