From 07e26a1dcfb3cc8431576f18369c090c4db855e3 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 10 Mar 2018 18:40:24 -0500 Subject: [PATCH] don't use toStream Ref #3979 toStream doesn't help performance. --- .../src/main/scala/sbt/internal/util/Settings.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/util-collection/src/main/scala/sbt/internal/util/Settings.scala b/internal/util-collection/src/main/scala/sbt/internal/util/Settings.scala index 910e1c089..0070f966b 100644 --- a/internal/util-collection/src/main/scala/sbt/internal/util/Settings.scala +++ b/internal/util-collection/src/main/scala/sbt/internal/util/Settings.scala @@ -35,10 +35,10 @@ private final class Settings0[Scope]( data.flatMap { case (scope, map) => map.keys.map(k => f(scope, k)) }.toSeq def get[T](scope: Scope, key: AttributeKey[T]): Option[T] = - delegates(scope).toStream.flatMap(sc => getDirect(sc, key)).headOption + delegates(scope).flatMap(sc => getDirect(sc, key)).headOption def definingScope(scope: Scope, key: AttributeKey[_]): Option[Scope] = - delegates(scope).toStream.find(sc => getDirect(sc, key).isDefined) + delegates(scope).find(sc => getDirect(sc, key).isDefined) def getDirect[T](scope: Scope, key: AttributeKey[T]): Option[T] = (data get scope).flatMap(_ get key)