From 90bad7cae9375e1c10138b12d1da0caec796e64d Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Thu, 5 Oct 2023 14:06:52 +0200 Subject: [PATCH] Avoid calculating PathRef for filtered out deps --- main/util/src/mill/util/CoursierSupport.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/util/src/mill/util/CoursierSupport.scala b/main/util/src/mill/util/CoursierSupport.scala index 90dd75f9d42..2fa9c7783e3 100644 --- a/main/util/src/mill/util/CoursierSupport.scala +++ b/main/util/src/mill/util/CoursierSupport.scala @@ -193,8 +193,11 @@ trait CoursierSupport { if (errors.isEmpty) { Result.Success( Agg.from( - successes.map(os.Path(_)).filter(_.ext == "jar").map(PathRef(_, quick = true)) - ).filter(x => resolveFilter(x.path)) ++ localTestDeps.flatten + successes + .map(os.Path(_)) + .filter(path => path.ext == "jar" && resolveFilter(path)) + .map(PathRef(_, quick = true)) + ) ++ localTestDeps.flatten ) } else { val errorDetails = errors.map(e => s"${System.lineSeparator()} ${e.describe}").mkString