Skip to content

Commit

Permalink
use magic number instead of one-time-use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
kohenkatz committed Feb 10, 2025
1 parent 950e40e commit 240f296
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const (
type Timestamp uint64

const _100nsPerSecond = 10000000
const _100nsPerMillisecond = 10000

// Time returns the time.Time representation of a Timestamp.
//
Expand Down Expand Up @@ -151,7 +150,7 @@ func TimestampFromV7(u UUID) (Timestamp, error) {
// type stores 100-nanosecond increments since 1582-10-15 00:00:00.
// This conversion multiplies ms by 10,000 to get 100-ns chunks and adds
// the difference between October 1582 and January 1970.
tsNanos := epochStart + (t * _100nsPerMillisecond)
tsNanos := epochStart + (t * 10000)
return Timestamp(tsNanos), nil
}

Expand Down

0 comments on commit 240f296

Please sign in to comment.