mirror of https://github.com/sbt/sbt.git
Used cached compiled map in LintUnused
Linting unused keys was adding a significant overhead to sbt project loading because Def.compiled is so slow. It was around 4 seconds in the sbt project on my computer.
This commit is contained in:
parent
6565618a15
commit
4a8e7c0734
|
|
@ -117,9 +117,7 @@ object LintUnused {
|
|||
val extracted = Project.extract(state)
|
||||
val structure = extracted.structure
|
||||
val display = Def.showShortKey(None) // extracted.showKey
|
||||
val actual = true
|
||||
val comp =
|
||||
Def.compiled(structure.settings, actual)(structure.delegates, structure.scopeLocal, display)
|
||||
val comp = structure.compiledMap
|
||||
val cMap = Def.flattenLocals(comp)
|
||||
val used: Set[ScopedKey[_]] = cMap.values.flatMap(_.dependencies).toSet
|
||||
val unused: Seq[ScopedKey[_]] = cMap.keys.filter(!used.contains(_)).toSeq
|
||||
|
|
|
|||
Loading…
Reference in New Issue