Skip to content

Commit 14207ff

Browse files
Max Maischeinkhwilliamson
authored andcommitted
Eliminate a variable keeping the length of a string
As per the discussion in #19268
1 parent 6e38c9e commit 14207ff

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

win32/win32.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,21 +1591,19 @@ win32_stat_low(HANDLE handle, const char *path, STRLEN len, Stat_t *sbuf) {
15911591
DllExport int
15921592
win32_stat(const char *path, Stat_t *sbuf)
15931593
{
1594-
size_t l = strlen(path);
15951594
dTHX;
15961595
BOOL expect_dir = FALSE;
15971596
int result;
15981597
HANDLE handle;
15991598

16001599
path = PerlDir_mapA(path);
1601-
l = strlen(path);
16021600

16031601
handle =
16041602
CreateFileA(path, FILE_READ_ATTRIBUTES,
16051603
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
16061604
NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
16071605
if (handle != INVALID_HANDLE_VALUE) {
1608-
result = win32_stat_low(handle, path, l, sbuf);
1606+
result = win32_stat_low(handle, path, strlen(path), sbuf);
16091607
CloseHandle(handle);
16101608
}
16111609
else {

0 commit comments

Comments
 (0)