From 89428db0f4eeb29867deb7ae05fe62bff9dd62ad Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Thu, 4 Jul 2019 22:37:44 +0700 Subject: [PATCH] remote: optimize UrlInfo.isin() This will use cached `_path`, which will use cached `_cparts`. Saves some time skipping repetitive parsing. --- dvc/path_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dvc/path_info.py b/dvc/path_info.py index 2d140f885..06699a89b 100644 --- a/dvc/path_info.py +++ b/dvc/path_info.py @@ -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) )