mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +08:00
Remove useless functions
This commit is contained in:
parent
141b5a4e2f
commit
5bf1ecb409
@ -144,35 +144,4 @@ fun Input.readLVNumber(): Number {
|
||||
8 -> this.readLong()
|
||||
else -> throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
//添加@JvmSynthetic 导致 idea 无法检查这个文件的错误
|
||||
//@JvmSynthetic
|
||||
@Deprecated("Low efficiency", ReplaceWith(""))
|
||||
fun <I : Input> I.gotoWhere(matcher: UByteArray): I {
|
||||
@Suppress("DEPRECATION")
|
||||
return this.gotoWhere(matcher.toByteArray())
|
||||
}
|
||||
|
||||
/**
|
||||
* 去往下一个含这些连续字节的位置
|
||||
*/
|
||||
@Deprecated("Low efficiency", ReplaceWith(""))
|
||||
fun <I : Input> I.gotoWhere(matcher: ByteArray): I {
|
||||
require(matcher.isNotEmpty())
|
||||
|
||||
loop@
|
||||
do {
|
||||
val byte = this.readByte()
|
||||
if (byte == matcher[0]) {
|
||||
//todo mark here
|
||||
for (i in 1 until matcher.size) {
|
||||
val b = this.readByte()
|
||||
if (b != matcher[i]) {
|
||||
continue@loop //todo goto mark
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
} while (true)
|
||||
}
|
Loading…
Reference in New Issue
Block a user