Skip to content

Commit

Permalink
micro-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-kussul committed Jan 9, 2025
1 parent f7e7c87 commit e219595
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func defaultEncode(num uint128) string {
buf[16], r = DefaultAlphabet[r%57], r/57
buf[15], r = DefaultAlphabet[r%57], r/57
buf[14], r = DefaultAlphabet[r%57], r/57
buf[13], r = DefaultAlphabet[r%57], r/57
buf[12] = DefaultAlphabet[r%57]
buf[13] = DefaultAlphabet[r%57]
buf[12] = DefaultAlphabet[r/57]
num, r = num.quoRem64(362033331456891249)
buf[11], r = DefaultAlphabet[r%57], r/57
buf[10], r = DefaultAlphabet[r%57], r/57
Expand All @@ -91,11 +91,11 @@ func defaultEncode(num uint128) string {
buf[6], r = DefaultAlphabet[r%57], r/57
buf[5], r = DefaultAlphabet[r%57], r/57
buf[4], r = DefaultAlphabet[r%57], r/57
buf[3], r = DefaultAlphabet[r%57], r/57
buf[2] = DefaultAlphabet[r%57]
buf[3] = DefaultAlphabet[r%57]
buf[2] = DefaultAlphabet[r/57]
_, r = num.quoRem64(362033331456891249)
buf[1], r = DefaultAlphabet[r%57], r/57
buf[0] = DefaultAlphabet[r%57]
buf[1] = DefaultAlphabet[r%57]
buf[0] = DefaultAlphabet[r/57]
return unsafe.String(unsafe.SliceData(buf[:]), 22)
}

Expand Down

0 comments on commit e219595

Please sign in to comment.