From 427714178ec89e3a24933a305a4de6ab1089847c Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 9 May 2010 17:25:35 +0000 Subject: Minor loading functions refactoring, fixed XPath append_node for MSVC10 git-svn-id: http://pugixml.googlecode.com/svn/trunk@395 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pugixpath.cpp') diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index 9d81438..dc25a0e 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -28,15 +28,15 @@ # include #endif -#include -#include - #if defined(_MSC_VER) # pragma warning(disable: 4127) // conditional expression is constant # pragma warning(disable: 4702) // unreachable code # pragma warning(disable: 4996) // this function or variable may be unsafe #endif +#include +#include + // String utilities prototypes namespace pugi { @@ -787,6 +787,8 @@ namespace pugi template void xpath_node_set::append(Iterator begin, Iterator end) { + if (begin == end) return; + size_t count = std::distance(begin, end); size_t size = m_end - m_begin; size_t capacity = m_eos - m_begin; -- cgit v1.2.3