mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-21 15:57:14 +00:00
Improve readability of Kotlin code (#1236)
* style(kotlin): Improve kotlin codes readability. * remove redundant quotes. * style(kotlin): improve codes readability.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
package chapter_hashing
|
||||
|
||||
const val MODULUS = 10_0000_0007
|
||||
const val MODULUS = 1000000007
|
||||
|
||||
/* 加法哈希 */
|
||||
fun addHash(key: String): Int {
|
||||
@@ -48,7 +48,7 @@ fun rotHash(key: String): Int {
|
||||
fun main() {
|
||||
val key = "Hello 算法"
|
||||
|
||||
var hash: Int = addHash(key)
|
||||
var hash = addHash(key)
|
||||
println("加法哈希值为 $hash")
|
||||
|
||||
hash = mulHash(key)
|
||||
|
||||
Reference in New Issue
Block a user