From ffd58b51b0b156a93c1707c5402758070900442d Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Sun, 3 Jul 2016 16:33:04 +0200 Subject: [PATCH] Minor refacto --- .../main/scala/coursier/core/Resolution.scala | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/core/shared/src/main/scala/coursier/core/Resolution.scala b/core/shared/src/main/scala/coursier/core/Resolution.scala index 466e273ed..9fd62c762 100644 --- a/core/shared/src/main/scala/coursier/core/Resolution.scala +++ b/core/shared/src/main/scala/coursier/core/Resolution.scala @@ -434,24 +434,18 @@ object Resolution { activation: Activation, props: Map[String, String] ): Boolean = - if (activation.properties.isEmpty) - false - else - activation - .properties - .forall {case (name, valueOpt) => - props - .get(name) - .exists{ v => - valueOpt - .forall { reqValue => - if (reqValue.startsWith("!")) - v != reqValue.drop(1) - else - v == reqValue - } + activation.properties.nonEmpty && + activation.properties.forall { + case (name, valueOpt) => + props.get(name).exists { v => + valueOpt.forall { reqValue => + if (reqValue.startsWith("!")) + v != reqValue.drop(1) + else + v == reqValue } - } + } + } def userProfileActivation(userProfiles: Set[String])( id: String,