Skip to content

Commit ab407e1

Browse files
committed
pythongh-108985: Make os.DirEntry.is_symlink ~twice as fast
1 parent 65a2bce commit ab407e1

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Modules/clinic/posixmodule.c.h

Lines changed: 5 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/posixmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14550,15 +14550,13 @@ DirEntry_test_mode(PyTypeObject *defining_class, DirEntry *self,
1455014550

1455114551
/*[clinic input]
1455214552
os.DirEntry.is_symlink -> bool
14553-
defining_class: defining_class
14554-
/
1455514553
1455614554
Return True if the entry is a symbolic link; cached per entry.
1455714555
[clinic start generated code]*/
1455814556

1455914557
static int
14560-
os_DirEntry_is_symlink_impl(DirEntry *self, PyTypeObject *defining_class)
14561-
/*[clinic end generated code: output=293096d589b6d47c input=e9acc5ee4d511113]*/
14558+
os_DirEntry_is_symlink_impl(DirEntry *self)
14559+
/*[clinic end generated code: output=42244667d7bcfc25 input=1605a1b4b96976c3]*/
1456214560
{
1456314561
#ifdef MS_WINDOWS
1456414562
return (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;

0 commit comments

Comments
 (0)