Make inspections happy without changing logic

GitOrigin-RevId: 865695ea6f8a28354f4c736cc6f625e174c78928
This commit is contained in:
Elena Shaverdova
2024-09-23 18:39:25 +00:00
committed by intellij-monorepo-bot
parent 8c13398318
commit 86cfe58290
@@ -16,7 +16,7 @@ import com.intellij.util.indexing.roots.origin.IndexingUrlRootHolder
import com.intellij.util.indexing.roots.origin.ModuleRootOriginImpl
/**
* @param rootHolder is null when iterator should just iterate all files in module, no explicit root list
* @param rootHolder is null when iterator should just iterate all files in [module], no explicit root list
*/
internal class ModuleIndexableFilesIteratorImpl private constructor(private val module: Module,
rootHolder: IndexingRootHolder?,
@@ -34,10 +34,10 @@ internal class ModuleIndexableFilesIteratorImpl private constructor(private val
fun createIterators(module: Module, urlRoots: IndexingUrlRootHolder): Collection<IndexableFilesIterator> {
val roots = urlRoots.toRootHolder()
if (roots.isEmpty()) return emptyList()
// 100 is a totally magic constant here, designed to help Rider to avoid indexing all non-recursive roots with one iterator => on a
// single thread
// 100 is a totally magic constant here, designed to help Rider to avoid indexing all non-recursive roots with one iterator,
// which results in indexing on a single thread
if (roots.size() > 100) {
return roots.split(100).map { rootSublists -> ModuleIndexableFilesIteratorImpl(module, rootSublists, true) }
return roots.split(100).map { rootSublist -> ModuleIndexableFilesIteratorImpl(module, rootSublist, true) }
}
return setOf(ModuleIndexableFilesIteratorImpl(module, roots, true))
}
@@ -99,7 +99,7 @@ internal class ModuleIndexableFilesIteratorImpl private constructor(private val
}
return nonRecursiveRoots?.all { root ->
if (runReadAction { index.isInContent(root) } && fileFilter.accept(root)) fileIterator.processFile(root) else true
} ?: true
} != false
}
}