Browse Source

Suppress false positive warnings

Him188 6 năm trước cách đây
mục cha
commit
5310e19861

+ 1 - 0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/platform.kt

@@ -46,6 +46,7 @@ expect fun localIpAddress(): String
  */
 expect val Http: HttpClient
 
+@Suppress("DuplicatedCode") // false positive. `this` is not the same for `List<Byte>` and `ByteArray`
 internal fun ByteArray.checkOffsetAndLength(offset: Int, length: Int) {
     require(offset >= 0) { "offset shouldn't be negative: $offset" }
     require(length >= 0) { "length shouldn't be negative: $length" }