Skip to content

Commit

Permalink
Merge pull request #750 from simple-robot/dev/pref-id-tostring
Browse files Browse the repository at this point in the history
优化无符号ID类型的 toString 效果
  • Loading branch information
ForteScarlet authored Jan 2, 2024
2 parents 4743817 + d908d64 commit 70fc444
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion simbot-api/src/main/kotlin/love/forte/simbot/ID.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023 ForteScarlet.
* Copyright (c) 2021-2024 ForteScarlet.
*
* This file is part of Simple Robot.
*
Expand Down Expand Up @@ -742,6 +742,8 @@ public data class UIntID(public val number: UInt) : ID(), NumberSimilarly {
return false
}

override fun toString(): String = number.toString()

public companion object {
/**
* [UInt.MAX_VALUE] 作为 [Long] 的值。
Expand Down Expand Up @@ -896,6 +898,8 @@ public data class ULongID(public val number: ULong) : ID(), NumberSimilarly {
return false
}

override fun toString(): String = number.toString()

public companion object {
// ULong MAX = 18446744073709551615
private val ULONG_MAX_BGD = BigDecimal(ULong.MAX_VALUE.toString())
Expand Down

0 comments on commit 70fc444

Please sign in to comment.