mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
4e1fe285c4
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. |
||
---|---|---|
.. | ||
base | ||
build | ||
components | ||
doc | ||
ds | ||
glue | ||
idl-parser | ||
io | ||
libxpt/xptcall | ||
reflect | ||
sample | ||
string | ||
system | ||
tests | ||
threads | ||
typelib | ||
windbgdlg | ||
xpidl | ||
Makefile.in | ||
moz.build | ||
xpcom-config.h.in | ||
xpcom-private.h.in |