瀏覽代碼

Suppress false positive warnings

Him188 6 年之前
父節點
當前提交
5310e19861
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/platform.kt

+ 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" }