Skip to content

Commit

Permalink
Fix Snowflake constructor taking an Instant (subtract milliseconds be…
Browse files Browse the repository at this point in the history
…fore shifting bits to the left).
  • Loading branch information
lukellmann committed Aug 24, 2021
1 parent a6ed033 commit 76a35b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/src/main/kotlin/entity/Snowflake.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Snowflake(val value: Long) : Comparable<Snowflake> {
/**
* Creates a Snowflake from a given [instant].
*/
constructor(instant: Instant) : this((instant.toEpochMilliseconds() shl 22) - discordEpochLong)
constructor(instant: Instant) : this((instant.toEpochMilliseconds() - discordEpochLong) shl 22)

val asString get() = value.toString()

Expand Down

0 comments on commit 76a35b6

Please sign in to comment.