From f9c78551437bace4404cafdde632af947309161c Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Thu, 3 Jun 2010 07:12:51 +0000 Subject: Minor strcpy_insitu optimization for large strings, removed now redundant impl::strcpy git-svn-id: http://pugixml.googlecode.com/svn/trunk@502 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 15 ++------------- src/pugixpath.cpp | 2 -- 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 6dcdbf6..5b668b0 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -99,7 +99,6 @@ namespace pugi namespace impl { size_t strlen(const char_t* s); - void strcpy(char_t* dst, const char_t* src); bool strequalrange(const char_t* lhs, const char_t* rhs, size_t count); void widen_ascii(wchar_t* dest, const char* source); } @@ -120,16 +119,6 @@ namespace pugi #endif } - // Copy one string into another - void strcpy(char_t* dst, const char_t* src) - { - #ifdef PUGIXML_WCHAR_MODE - wcscpy(dst, src); - #else - ::strcpy(dst, src); - #endif - } - // Compare two strings bool PUGIXML_FUNCTION strequal(const char_t* src, const char_t* dst) { @@ -1336,7 +1325,7 @@ namespace if (dest && impl::strlen(dest) >= source_length) { - impl::strcpy(dest, source); + memcpy(dest, source, (source_length + 1) * sizeof(char_t)); return true; } @@ -1347,7 +1336,7 @@ namespace char_t* buf = alloc->allocate_string(source_length + 1); if (!buf) return false; - impl::strcpy(buf, source); + memcpy(buf, source, (source_length + 1) * sizeof(char_t)); if (header & header_mask) alloc->deallocate_string(dest); diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index 77d1e71..8e35478 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -52,8 +52,6 @@ namespace pugi { namespace impl { - size_t strlen(const char_t* s); - void strcpy(char_t* dst, const char_t* src); bool strequalrange(const char_t* lhs, const char_t* rhs, size_t count); void widen_ascii(wchar_t* dest, const char* source); } -- cgit v1.2.3