Skip to content

Commit 452dec0

Browse files
committed
isSameLocation predicate
1 parent 9d8e9f3 commit 452dec0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/commonMain/kotlin/spp.protocol/instrument/LiveSourceLocation.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,14 @@ data class LiveSourceLocation @JvmOverloads constructor(
4242
if (sourceCompare != 0) return sourceCompare
4343
return line.compareTo(other.line)
4444
}
45+
46+
fun isSameLocation(other: LiveSourceLocation): Boolean {
47+
if (source != other.source) return false
48+
if (line != other.line && line != -1 && other.line != -1) return false //-1 is wildcard
49+
if (service != other.service) return false
50+
if (serviceInstance != other.serviceInstance) return false
51+
if (commitId != other.commitId) return false
52+
if (fileChecksum != other.fileChecksum) return false
53+
return true
54+
}
4555
}

0 commit comments

Comments
 (0)