Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: webkit/data/test_shell/sort/sort-quick.js

Issue 401923005: webkit: Remove all files from test_shell/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/data/test_shell/sort/sort-insertion.js ('k') | webkit/data/test_shell/test.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/data/test_shell/sort/sort-quick.js
diff --git a/webkit/data/test_shell/sort/sort-quick.js b/webkit/data/test_shell/sort/sort-quick.js
deleted file mode 100644
index 40d3804acf3b6221384dad71abc1a91060cd752f..0000000000000000000000000000000000000000
--- a/webkit/data/test_shell/sort/sort-quick.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// quicksort
-
-function sort_quick(sort, left, right) {
- if (arguments.length == 1) {
- left = 0;
- right = sort.size - 1;
- }
- if (left < right) {
- var pivot = left + Math.floor(Math.random()*(right-left));
- //var pivot = Math.floor(left + (right-left)/2);
- partition(sort, left, right, pivot);
- }
-}
-
-function partition(sort, left, right, pivot) {
- sort.swap(pivot, right);
- sort.add_work(function(){partition_step(sort, left, right, pivot, left, left);});
-}
-
-function partition_step(sort, left, right, pivot, i, j) {
- if (i < right) {
- if (sort.compare(i, right) <= 0) {
- sort.swap(i, j);
- j++;
- }
- i++;
- sort.add_work(function(){partition_step(sort, left, right, pivot, i, j)});
- } else {
- sort.swap(j, right);
- sort.add_work(function(){sort_quick(sort, left, j-1)});
- sort.add_work(function(){sort_quick(sort, j+1, right)});
- }
-}
-
« no previous file with comments | « webkit/data/test_shell/sort/sort-insertion.js ('k') | webkit/data/test_shell/test.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698