mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.fs.path.joinSepMaybeZ: replace while-loops with for-loops
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
This commit is contained in:
parent
d5db02728c
commit
5bbf3f5561
1 changed files with 2 additions and 6 deletions
|
|
@ -90,9 +90,7 @@ fn joinSepMaybeZ(allocator: Allocator, separator: u8, comptime sepPredicate: fn
|
|||
var sum: usize = paths[first_path_index].len;
|
||||
var prev_path = paths[first_path_index];
|
||||
assert(prev_path.len > 0);
|
||||
var i: usize = first_path_index + 1;
|
||||
while (i < paths.len) : (i += 1) {
|
||||
const this_path = paths[i];
|
||||
for (paths[first_path_index + 1 ..]) |this_path| {
|
||||
if (this_path.len == 0) continue;
|
||||
const prev_sep = sepPredicate(prev_path[prev_path.len - 1]);
|
||||
const this_sep = sepPredicate(this_path[0]);
|
||||
|
|
@ -112,9 +110,7 @@ fn joinSepMaybeZ(allocator: Allocator, separator: u8, comptime sepPredicate: fn
|
|||
var buf_index: usize = paths[first_path_index].len;
|
||||
var prev_path = paths[first_path_index];
|
||||
assert(prev_path.len > 0);
|
||||
var i: usize = first_path_index + 1;
|
||||
while (i < paths.len) : (i += 1) {
|
||||
const this_path = paths[i];
|
||||
for (paths[first_path_index + 1 ..]) |this_path| {
|
||||
if (this_path.len == 0) continue;
|
||||
const prev_sep = sepPredicate(prev_path[prev_path.len - 1]);
|
||||
const this_sep = sepPredicate(this_path[0]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue