mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 23:10:10 +01:00
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:
+2
-2
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user