Skip to content

Commit a11cdb6

Browse files
squeek502andrewrk
authored andcommitted
os.realpathW: Reduce the number of OpenFile calls for directories
Same as a190582 but for os.realpathW instead of fs.Dir.realpathW
1 parent 4c97919 commit a11cdb6

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

lib/std/os.zig

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5149,18 +5149,8 @@ pub fn realpathW(pathname: []const u16, out_buffer: *[MAX_PATH_BYTES]u8) RealPat
51495149
.share_access = share_access,
51505150
.creation = creation,
51515151
.io_mode = .blocking,
5152+
.filter = .any,
51525153
}) catch |err| switch (err) {
5153-
error.IsDir => break :blk w.OpenFile(pathname, .{
5154-
.dir = dir,
5155-
.access_mask = access_mask,
5156-
.share_access = share_access,
5157-
.creation = creation,
5158-
.io_mode = .blocking,
5159-
.filter = .dir_only,
5160-
}) catch |er| switch (er) {
5161-
error.WouldBlock => unreachable,
5162-
else => |e2| return e2,
5163-
},
51645154
error.WouldBlock => unreachable,
51655155
else => |e| return e,
51665156
};

0 commit comments

Comments
 (0)