We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5ab104d + 291a674 commit 623a75cCopy full SHA for 623a75c
src/Algorithm/Sorting/QuickSort.php
@@ -5,6 +5,8 @@
5
*
6
* Copyright (c) 2018 Dogan Ucar
7
8
+ * @author Alexey Berezuev <alexey@berezuev.ru>
9
+ *
10
* Permission is hereby granted, free of charge, to any person obtaining a copy
11
* of this software and associated documentation files (the "Software"), to deal
12
* in the Software without restriction, including without limitation the rights
@@ -51,7 +53,7 @@ public function sort(array $array): array {
51
53
$pivot = $array[0];
52
54
$left = $right = [];
55
- for ($i = 1; $i < count($array); $i++) {
56
+ for ($i = 1; $i < $size; $i++) {
57
if (Comparator::lessThan($array[$i], $pivot)) {
58
$left[] = $array[$i];
59
} else {
0 commit comments