From 688a8ca303e41a70b14c07d2ac91cc1e89f9e86b Mon Sep 17 00:00:00 2001
From: Alberto Massari <amassari@apache.org>
Date: Mon, 11 Dec 2006 15:04:27 +0000
Subject: [PATCH] Reuse existing method

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@485688 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/util/QName.cpp | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/xercesc/util/QName.cpp b/src/xercesc/util/QName.cpp
index 9d34e9c36..cf30c351a 100644
--- a/src/xercesc/util/QName.cpp
+++ b/src/xercesc/util/QName.cpp
@@ -323,20 +323,7 @@ void QName::setName(const XMLCh* const    rawName
 
 void QName::setPrefix(const XMLCh* prefix)
 {
-    unsigned int newLen;
-
-    newLen = XMLString::stringLen(prefix);
-    if (!fPrefixBufSz || (newLen > fPrefixBufSz))
-    {
-        fMemoryManager->deallocate(fPrefix); //delete [] fPrefix;
-        fPrefix = 0;
-        fPrefixBufSz = newLen + 8;
-        fPrefix = (XMLCh*) fMemoryManager->allocate
-        (
-            (fPrefixBufSz + 1) * sizeof(XMLCh)
-        ); //new XMLCh[fPrefixBufSz + 1];
-    }
-    XMLString::moveChars(fPrefix, prefix, newLen + 1);
+    setNPrefix(prefix, XMLString::stringLen(prefix));
 }
 
 void QName::setNPrefix(const XMLCh* prefix, const unsigned int newLen)
-- 
GitLab