summaryrefslogtreecommitdiff
path: root/src/pugixpath.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-09 17:25:35 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-09 17:25:35 +0000
commit427714178ec89e3a24933a305a4de6ab1089847c (patch)
tree4434a799bc0316d4716a35d965de45a238387640 /src/pugixpath.cpp
parentca9704d65181111a182bce3ad97913dd4cfd6058 (diff)
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
Diffstat (limited to 'src/pugixpath.cpp')
-rw-r--r--src/pugixpath.cpp8
1 files changed, 5 insertions, 3 deletions
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 <wchar.h>
#endif
-#include <algorithm>
-#include <string>
-
#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 <algorithm>
+#include <string>
+
// String utilities prototypes
namespace pugi
{
@@ -787,6 +787,8 @@ namespace pugi
template <typename Iterator> 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;