Skip to content

Commit

Permalink
Remove FixedBytes method in hyper position
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Díaz <[email protected]>
  • Loading branch information
aalda and gdiazlo committed Feb 25, 2019
1 parent 17e27a9 commit 2f41332
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions balloon/hyper2/navigation/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@ import (
"github.com/bbva/qed/util"
)

const KeySize = 34

type Position struct {
Index []byte
Height uint16

serialized [KeySize]byte
serialized []byte
numBits uint16
}

func NewPosition(index []byte, height uint16) Position {
var b [KeySize]byte // Size of the index plus 2 bytes for the height
copy(b[:], index[:len(index)])
copy(b[len(index):], util.Uint16AsBytes(height))
// Size of the index plus 2 bytes for the height
b := append(append([]byte{}, index[:len(index)]...), util.Uint16AsBytes(height)...)
return Position{
Index: index,
Height: height,
Expand All @@ -49,10 +46,6 @@ func NewRootPosition(numBits uint16) Position {
}

func (p Position) Bytes() []byte {
return p.serialized[:]
}

func (p Position) FixedBytes() [KeySize]byte {
return p.serialized
}

Expand Down

0 comments on commit 2f41332

Please sign in to comment.