dbertoni 02/05/05 22:18:45
Modified: c/src/PlatformSupport StringTokenizer.cpp URISupport.cpp
Log:
More efficient string use.
Revision Changes Path
1.9 +10 -6 xml-xalan/c/src/PlatformSupport/StringTokenizer.cpp
Index: StringTokenizer.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/StringTokenizer.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StringTokenizer.cpp 26 Sep 2001 21:46:27 -0000 1.8
+++ StringTokenizer.cpp 6 May 2002 05:18:45 -0000 1.9
@@ -173,9 +173,11 @@
// The next delimiter is at the current index. If we're
// returning delimiters as tokens, then make that the
// return value. Otherwise, return an empty string.
- theToken = substring(m_String,
- theIndex,
- theIndex + 1);
+ substring(
+ m_String,
+ theToken,
+ theIndex,
+ theIndex + 1);
}
else if (m_CurrentIndex < m_StringLength)
{
@@ -190,9 +192,11 @@
}
assert(theIndex > m_CurrentIndex);
- theToken = substring(m_String,
- m_CurrentIndex,
- theIndex);
+ substring(
+ m_String,
+ theToken,
+ m_CurrentIndex,
+ theIndex);
m_CurrentIndex = theIndex;
}
1.19 +6 -2 xml-xalan/c/src/PlatformSupport/URISupport.cpp
Index: URISupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/URISupport.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- URISupport.cpp 4 Apr 2002 06:18:28 -0000 1.18
+++ URISupport.cpp 6 May 2002 05:18:45 -0000 1.19
@@ -133,9 +133,11 @@
if (index != len)
{
+ const XalanDOMString theProtocolString(urlString,
index);
+
// $$$ ToDo: XMLURL::lookupByName() is supposed to be
static, but is not.
const XMLURL::Protocols theProtocol =
-
XMLURL().lookupByName(c_wstr(substring(urlString, 0 , index)));
+
XMLURL().lookupByName(c_wstr(theProtocolString));
if (theProtocol != XMLURL::Unknown)
{
@@ -277,7 +279,9 @@
// OK, everything looks good, so strip
off the protocol
// and colon...
- context += substring(urlString,
theColonIndex + 1, urlStringLen);
+ context.append(
+ urlString +
theColonIndex + 1,
+ urlStringLen -
(theColonIndex + 1));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]