Added an optimization to return early if there's no replacements to be made
* platform/StringImpl.cpp:
(WebCore::StringImpl::replace):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16080
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-08-28 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adele and Adam
+
+ Added an optimization to return early if there's no replacements to be made
+
+ * platform/StringImpl.cpp:
+ (WebCore::StringImpl::replace):
+
2006-08-28 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed and landed by ap.
++srcSegmentStart;
}
+ // If we have 0 matches, we don't have to do any more work
+ if (!matchCount)
+ return this;
+
// Create the new StringImpl;
StringImpl* dst = new StringImpl();
dst->m_length = m_length - matchCount + (matchCount * repStrLength);