mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
dvc: some minor optimizations
This commit is contained in:
+2
-2
@@ -469,10 +469,10 @@ class RemoteBase(object):
|
||||
def gc(self, cinfos):
|
||||
from dvc.remote.local import RemoteLOCAL
|
||||
|
||||
used = [info[RemoteLOCAL.PARAM_CHECKSUM] for info in cinfos["local"]]
|
||||
used = {info[RemoteLOCAL.PARAM_CHECKSUM] for info in cinfos["local"]}
|
||||
|
||||
if self.scheme != "":
|
||||
used += [info[self.PARAM_CHECKSUM] for info in cinfos[self.scheme]]
|
||||
used |= {info[self.PARAM_CHECKSUM] for info in cinfos[self.scheme]}
|
||||
|
||||
removed = False
|
||||
for checksum in self.all():
|
||||
|
||||
@@ -285,12 +285,14 @@ class Repo(object):
|
||||
|
||||
for out in stage.outs:
|
||||
scheme = out.path_info["scheme"]
|
||||
cache[scheme] += self._collect_used_cache(
|
||||
out,
|
||||
branch=branch,
|
||||
remote=remote,
|
||||
force=force,
|
||||
jobs=jobs,
|
||||
cache[scheme].extend(
|
||||
self._collect_used_cache(
|
||||
out,
|
||||
branch=branch,
|
||||
remote=remote,
|
||||
force=force,
|
||||
jobs=jobs,
|
||||
)
|
||||
)
|
||||
|
||||
return cache
|
||||
|
||||
Reference in New Issue
Block a user