It's slightly faster to reject params in one line than on many.

This commit is contained in:
Vitor Pamplona
2025-02-22 16:17:10 -05:00
parent dc4240a8f5
commit 4b10dd58df
@@ -38,9 +38,7 @@ object Hex {
@JvmStatic
fun isHex(hex: String?): Boolean {
if (hex == null) return false
if (hex.isEmpty()) return false
if (hex.length and 1 != 0) return false // must be even
if (hex.isNullOrEmpty() || hex.length and 1 != 0) return false
try {
for (c in hex.indices) {