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