Skip to content

Commit

Permalink
use String.hashCode for better diffusion
Browse files Browse the repository at this point in the history
  • Loading branch information
schlawg authored Oct 17, 2024
1 parent 1755068 commit 678f3cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/api/src/main/SocketTestResult.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class SocketTestResult(resultsDb: lila.db.AsyncCollFailingSilently)(using
object SocketTest:

def isUserInTestBucket(net: NetConfig)(using ctx: Context) =
net.socketTest && ctx.pref.usingAltSocket.isEmpty && ctx.userId.exists(_.value.toList.sum % 128 == 0)
net.socketTest && ctx.pref.usingAltSocket.isEmpty && ctx.userId.exists(_.value.hashCode % 128 == 0)

def socketEndpoints(net: NetConfig)(using ctx: Context): List[String] =
ctx.pref.usingAltSocket.match
Expand Down

0 comments on commit 678f3cb

Please sign in to comment.