aboutsummaryrefslogtreecommitdiff
path: root/lib/std/sort
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-11-10 05:27:17 +0000
committermlugg <mlugg@mlugg.co.uk>2023-11-19 09:55:07 +0000
commit51595d6b75d8ac2443a2c142c71f2a617c12fe96 (patch)
tree0e3045793aa36cc8569181cc790d270c4f056806 /lib/std/sort
parentbaabc6013ea4f44082e69375214e76b5d803c5cb (diff)
downloadzig-51595d6b75d8ac2443a2c142c71f2a617c12fe96.tar.gz
zig-51595d6b75d8ac2443a2c142c71f2a617c12fe96.zip
lib: correct unnecessary uses of 'var'
Diffstat (limited to 'lib/std/sort')
-rw-r--r--lib/std/sort/block.zig4
-rw-r--r--lib/std/sort/pdq.zig8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/sort/block.zig b/lib/std/sort/block.zig
index fe6e628653..4c94fb78ad 100644
--- a/lib/std/sort/block.zig
+++ b/lib/std/sort/block.zig
@@ -302,8 +302,8 @@ pub fn block(
} else {
iterator.begin();
while (!iterator.finished()) {
- var A = iterator.nextRange();
- var B = iterator.nextRange();
+ const A = iterator.nextRange();
+ const B = iterator.nextRange();
if (lessThan(context, items[B.end - 1], items[A.start])) {
// the two ranges are in reverse order, so a simple rotation should fix it
diff --git a/lib/std/sort/pdq.zig b/lib/std/sort/pdq.zig
index 0e1595b82c..d74c7788a4 100644
--- a/lib/std/sort/pdq.zig
+++ b/lib/std/sort/pdq.zig
@@ -276,10 +276,10 @@ fn chosePivot(a: usize, b: usize, pivot: *usize, context: anytype) Hint {
// max_swaps is the maximum number of swaps allowed in this function
const max_swaps = 4 * 3;
- var len = b - a;
- var i = a + len / 4 * 1;
- var j = a + len / 4 * 2;
- var k = a + len / 4 * 3;
+ const len = b - a;
+ const i = a + len / 4 * 1;
+ const j = a + len / 4 * 2;
+ const k = a + len / 4 * 3;
var swaps: usize = 0;
if (len >= 8) {