Skip to content

Commit

Permalink
remove TODO, use bitshift
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Dec 2, 2024
1 parent b79ca1d commit 9ae9a32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions contracts/LinearCodeAddressGenerator.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ contract LinearCodeAddressGenerator {
access(all)
fun address(at index: UInt64, chain: Chain): Address? {
// The index must be in the range [1 .. 2^45 - 1]
// TODO: Use Cadence exponentiation operator, once available
if index < 1 || index > 35184372088831 {
if index < 1 || index > (2 << 44) - 1 {
return nil
}
return Address(self.encodeWord(index) ^ self.invalidCodeWord(forChain: chain))
Expand Down
6 changes: 3 additions & 3 deletions lib/go/contracts/internal/assets/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ae9a32

Please sign in to comment.