auriemma 00/11/07 08:03:57
Modified: c/src/XPath FunctionConcat.cpp
Log:
Merged string class changes from hpp to cpp.
Revision Changes Path
1.2 +20 -3 xml-xalan/c/src/XPath/FunctionConcat.cpp
Index: FunctionConcat.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionConcat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FunctionConcat.cpp 2000/11/06 19:49:15 1.1
+++ FunctionConcat.cpp 2000/11/07 16:03:54 1.2
@@ -117,13 +117,30 @@
int
/* opPos */,
const XObjectArgVectorType& args)
{
- const XObjectArgVectorType::size_type theArgCount = args.size();
+ unsigned int theCombinedLength = 0;
+ const XObjectArgVectorType::const_iterator theEnd = args.end();
+
+ {
+ XObjectArgVectorType::const_iterator i = args.begin();
+
+ for(; i != theEnd; ++i)
+ {
+ theCombinedLength += length((*i)->str());
+ }
+ }
+
XalanDOMString theResult;
+
+ reserve(theResult, theCombinedLength + 1);
- for(XObjectArgVectorType::size_type i = 0; i < theArgCount; i++)
{
- theResult += args[i]->str();
+ XObjectArgVectorType::const_iterator i = args.begin();
+
+ for(; i != theEnd; ++i)
+ {
+ theResult += (*i)->str();
+ }
}
return executionContext.getXObjectFactory().createString(theResult);