Skip to content

Commit 0790365

Browse files
author
mik-laj
committed
Remove return; change functional to declarative
1 parent 5942846 commit 0790365

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/sorting/quicksort-functional.js renamed to src/sorting/quicksort-declarative.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88

99
/**
10-
* Quicksort algorithm (functional variant)
10+
* Quicksort algorithm (declarative variant)
1111
*
1212
* @public
1313
* @param {array} array Array which should be sorted.
@@ -21,7 +21,7 @@
2121
* @private
2222
* @param {array} array Array which should be processed
2323
*/
24-
return function quickSort(array, cmp) {
24+
function quickSort(array, cmp) {
2525
if (array.length < 1) {
2626
return arr;
2727
}
@@ -38,17 +38,17 @@
3838

3939
/**
4040
* Quicksort algorithm. In this version of quicksort used
41-
* functional programming mechanisms.<br><br>
41+
* declarative programming mechanisms.<br><br>
4242
* Time complexity: O(N log(N)).
4343
*
4444
* @example
4545
*
4646
* var sort = require('path-to-algorithms/src' +
47-
* '/sorting/quicksort-functional').quickSort;
47+
* '/sorting/quicksort-declarative').quickSort;
4848
* console.log(sort([2, 5, 1, 0, 4])); // [ 0, 1, 2, 4, 5 ]
4949
*
5050
* @public
51-
* @module sorting/quicksort-functional
51+
* @module sorting/quicksort-declarative
5252
* @param {Array} array Input array.
5353
* @param {Function} cmp Optional. A function that defines an
5454
* alternative sort order. The function should return a negative,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var sortTestCase = require('./sort.testcase.js');
22
var quickSort =
3-
require('../../src/sorting/quicksort-functional.js').quickSort;
3+
require('../../src/sorting/quicksort-declarative.js').quickSort;
44

55
sortTestCase(quickSort, 'Quick sort');

0 commit comments

Comments
 (0)