Minor refacto

This commit is contained in:
Alexandre Archambault 2016-07-03 16:33:04 +02:00
parent efb4f6c5c0
commit ffd58b51b0
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
1 changed files with 11 additions and 17 deletions

View File

@ -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,