Skip to content

Commit

Permalink
delete unused referencedPackages
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Dec 19, 2023
1 parent 427db6f commit 61a8dbd
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ final class ReferenceProvider(
compilers: Compilers,
)(implicit ec: ExecutionContext)
extends SemanticdbFeatureProvider {
private var referencedPackages: BloomFilter[CharSequence] =
BloomFilters.create(10000)

case class IndexEntry(
id: BuildTargetIdentifier,
Expand Down Expand Up @@ -75,9 +73,6 @@ final class ReferenceProvider(
index(file.toNIO) = entry
docs.documents.foreach { d =>
d.occurrences.foreach { o =>
if (o.symbol.endsWith("/")) {
referencedPackages.put(o.symbol)
}
bloom.put(o.symbol)
}
d.synthetics.foreach { synthetic =>
Expand All @@ -87,7 +82,6 @@ final class ReferenceProvider(
}
}
}
resizeReferencedPackages()
}
}

Expand Down Expand Up @@ -477,14 +471,6 @@ final class ReferenceProvider(
(range: s.Range, _: String, _: String) => Some(range)
type AdjustRange = (s.Range, String, String) => Option[s.Range]

private def resizeReferencedPackages(): Unit = {
// Increase the size of the set of referenced packages if the false positive ratio is too high.
if (referencedPackages.expectedFpp() > 0.05) {
referencedPackages =
BloomFilters.create(referencedPackages.approximateElementCount() * 2)
}
}

}

class SymbolAlternatives(symbol: String, name: String) {
Expand Down

0 comments on commit 61a8dbd

Please sign in to comment.