diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-04-05 12:35:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 12:35:01 (GMT) |
commit | abfa16b44bb9426312613893b6e193b02ee0304f (patch) | |
tree | 1056d6152eb26836e630e4a5974f7e2201aea6a1 /Grammar/python.gram | |
parent | 9ceaee74db7da0e71042ab0b385d844e9f282adb (diff) | |
download | cpython-abfa16b44bb9426312613893b6e193b02ee0304f.zip cpython-abfa16b44bb9426312613893b6e193b02ee0304f.tar.gz cpython-abfa16b44bb9426312613893b6e193b02ee0304f.tar.bz2 |
GH-114847: Speed up `posixpath.realpath()` (#114848)
Apply the following optimizations to `posixpath.realpath()`:
- Remove use of recursion
- Construct child paths directly rather than using `join()`
- Use `os.getcwd[b]()` rather than `abspath()`
- Use `startswith(sep)` rather than `isabs()`
- Use slicing rather than `split()`
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Grammar/python.gram')
0 files changed, 0 insertions, 0 deletions