Regression(r116408): Ctrl-A (select all) on large text file hangs the tab with high...
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jun 2012 19:33:02 +0000 (19:33 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jun 2012 19:33:02 +0000 (19:33 +0000)
commita4441143bfba10af29d77319a4f70216339f4b01
tree88a9e0a2924ea69a0ba8dfd97150ceca680edd6c
parent7fed28ef32279bc20a405199f558dab548fb9c76
Regression(r116408): Ctrl-A (select all) on large text file hangs the tab with high CPU usage
https://bugs.webkit.org/show_bug.cgi?id=89562

Reviewed by Ryosuke Niwa.

Rather than replace the newlines in-place (in O(n^2)), build a new string using StringBuilder, which takes O(n).

No new tests, this is a perf improvement.

* platform/chromium/ClipboardUtilitiesChromium.cpp:
(WebCore::replaceNewlinesWithWindowsStyleNewlines):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::replaceNewlinesWithWindowsStyleNewlines):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp
Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp