remote: optimize UrlInfo.isin()

This will use cached `_path`, which will use cached `_cparts`. Saves
some time skipping repetitive parsing.
This commit is contained in:
Alexander Schepanovski
2019-07-04 22:39:05 +07:00
parent 5bf462bebe
commit 89428db0f4
+2 -2
View File
@@ -172,7 +172,7 @@ class URLInfo(object):
@cached_property
def _path(self):
return pathlib.PurePosixPath(self.parsed.path)
return PosixPathInfo(self.parsed.path)
@property
def name(self):
@@ -210,7 +210,7 @@ class URLInfo(object):
return (
self.scheme == other.scheme
and self.netloc == other.netloc
and PathInfo(self.path).isin(PathInfo(other.path))
and self._path.isin(other._path)
)