Skip to content

gh-108985: Make os.DirEntry.is_symlink ~twice as fast#108986

Closed
sobolevn wants to merge 1 commit intopython:mainfrom
sobolevn:issue-108985
Closed

gh-108985: Make os.DirEntry.is_symlink ~twice as fast#108986
sobolevn wants to merge 1 commit intopython:mainfrom
sobolevn:issue-108985

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 6, 2023

Two faster functions are twice as good as one faster function 😄

@sobolevn
Copy link
Member Author

sobolevn commented Sep 6, 2023

Oh,

#elif defined(HAVE_DIRENT_D_TYPE)
    /* POSIX */
    if (self->d_type != DT_UNKNOWN)
        return self->d_type == DT_LNK;
    else
        return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
#else
    /* POSIX without d_type */
    return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
#endif

@sobolevn sobolevn closed this Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments