Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Closed
Description
relpath()
unconditionally callsabspath()
to make both its arguments absolute before comparing them. This is necessary if the supplied arguments have different anchors, but it isnot necessary when the paths' anchors match. We can save a call togetcwd()
/_getfinalpathname()
by skipping theabspath()
call in this case. This should improve performance a little.
For example, neither of the following should require a call toabspath()
internally:
relpath('foo/bar','baz/ding')relpath('/etc/hosts','/usr/local/bin')