HMPP: Fix isCommon calculation for the K2 HMPP case

This commit is contained in:
Ilya Chernikov
2023-10-25 14:05:57 +02:00
committed by Space Team
parent 968dfddbc9
commit 76eda0095e
2 changed files with 9 additions and 1 deletions
@@ -23,3 +23,7 @@ class HmppCliModuleStructure(
fun HmppCliModuleStructure.getModuleNameForSource(source: String): String? {
return modules.firstOrNull { source in it.sources }?.name
}
fun HmppCliModuleStructure.isFromCommonModule(source: String): Boolean {
return modules.indexOfFirst { source in it.sources }.let { it >= 0 && it < modules.size - 1 }
}