From 8e4906f410465248aea23cd29c55eb0564dbffb7 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 14 Aug 2011 10:53:38 -0400 Subject: [PATCH] fix undefined key suggestion for updating settings --- util/collection/Settings.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/collection/Settings.scala b/util/collection/Settings.scala index 48aff00e8..c0ab96e18 100644 --- a/util/collection/Settings.scala +++ b/util/collection/Settings.scala @@ -170,12 +170,12 @@ trait Init[Scope] distances.sortBy(_._1).map(_._2).headOption } def refinedDistance(delegates: Scope => Seq[Scope], a: ScopedKey[_], b: ScopedKey[_]): Option[Int] = - if(a.key == b.key) + if(a.key != b.key || a == b) None + else { val dist = delegates(a.scope).indexOf(b.scope) if(dist < 0) None else Some(dist) } - else None final class Uninitialized(val undefined: Seq[Undefined], msg: String) extends Exception(msg) final class Undefined(val definingKey: ScopedKey[_], val referencedKey: ScopedKey[_])