mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
5b56680479
ReplaceSubstring() is an O(n*m) algorithm (n being the length of the string and m being the number of occurrences of aTarget) because we have to move the remainder of the string, search it again and potentially memmove most of it again as we find more matches. This patch rewrites that function to make it O(n+m). Note that we currently don't build TestStrings.cpp, so the test case in this patch is not run automatically, but the test case has been verified to pass separately by moving the test function into Gecko and calling it during startup and stepping through it in the debugger. --HG-- extra : rebase_source : b020e17c1973330b0dbbd6bf956c073cfdcb775e |
||
---|---|---|
.. | ||
crashtests | ||
moz.build | ||
nsAlgorithm.h | ||
nsAString.h | ||
nsCharTraits.h | ||
nsDependentString.cpp | ||
nsDependentString.h | ||
nsDependentSubstring.cpp | ||
nsDependentSubstring.h | ||
nsEmbedString.h | ||
nsLiteralString.h | ||
nsPrintfCString.h | ||
nsPromiseFlatString.cpp | ||
nsPromiseFlatString.h | ||
nsReadableUtils.cpp | ||
nsReadableUtils.h | ||
nsString.cpp | ||
nsString.h | ||
nsStringBuffer.h | ||
nsStringComparator.cpp | ||
nsStringFwd.h | ||
nsStringIterator.h | ||
nsStringObsolete.cpp | ||
nsSubstring.cpp | ||
nsSubstring.h | ||
nsSubstringTuple.cpp | ||
nsSubstringTuple.h | ||
nsTDependentString.cpp | ||
nsTDependentString.h | ||
nsTDependentSubstring.cpp | ||
nsTDependentSubstring.h | ||
nsTLiteralString.h | ||
nsTPromiseFlatString.cpp | ||
nsTPromiseFlatString.h | ||
nsTString.cpp | ||
nsTString.h | ||
nsTStringComparator.cpp | ||
nsTStringObsolete.cpp | ||
nsTSubstring.cpp | ||
nsTSubstring.h | ||
nsTSubstringTuple.cpp | ||
nsTSubstringTuple.h | ||
nsUTF8Utils.h | ||
nsUTF8UtilsSSE2.cpp | ||
nsXPCOMStrings.h | ||
nsXPIDLString.h | ||
README.html | ||
string-template-def-char.h | ||
string-template-def-unichar.h | ||
string-template-undef.h |
<html> <!-- This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <body> <h1><span class="LXRSHORTDESC">managing sequences of characters</span></h1> <p> <span class="LXRLONGDESC"></span> </p> </body> </html>