From 6dc6f8bdc7df6793cc9b09f33e3fdc8bbb76a192 Mon Sep 17 00:00:00 2001
From: "arseny.kapoulkine"
 <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>
Date: Mon, 20 Sep 2010 18:14:02 +0000
Subject: [PATCH] xml_parse_result now has a default ctor, minor parsing
 optimization

git-svn-id: http://pugixml.googlecode.com/svn/trunk@736 99668b35-9821-0410-8761-19e4c4f06640
---
 src/pugixml.cpp | 8 ++++++--
 src/pugixml.hpp | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index f9d4ad62..7063fc38 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -1796,7 +1796,10 @@ namespace
 
 	inline xml_parse_result make_parse_result(xml_parse_status status, ptrdiff_t offset = 0)
 	{
-		xml_parse_result result = {status, offset, encoding_auto};
+		xml_parse_result result;
+		result.status = status;
+		result.offset = offset;
+
 		return result;
 	}
 
@@ -2276,7 +2279,8 @@ namespace
 					{
 						s = parse_question(s, cursor, optmsk, endch);
 
-						if (cursor && (cursor->header & xml_memory_page_type_mask) == node_declaration) goto LOC_ATTRIBUTES;
+						assert(cursor);
+						if ((cursor->header & xml_memory_page_type_mask) == node_declaration) goto LOC_ATTRIBUTES;
 					}
 					else if (*s == '!') // '<!...'
 					{
diff --git a/src/pugixml.hpp b/src/pugixml.hpp
index fbb9fccb..89494bf9 100644
--- a/src/pugixml.hpp
+++ b/src/pugixml.hpp
@@ -1558,6 +1558,10 @@ namespace pugi
 		/// Source document encoding
 		xml_encoding encoding;
 
+		xml_parse_result(): status(status_internal_error), offset(0), encoding(encoding_auto)
+		{
+		}
+
 		/// Cast to bool operator
 		operator bool() const
 		{
-- 
GitLab