mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
lnd: partially fix golint warnings
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
92dec2a902
commit
fd97a4bd19
@@ -63,9 +63,9 @@ func (e *element) derive(toIndex index) (*element, error) {
|
||||
}
|
||||
|
||||
// isEqual returns true if two elements are identical and false otherwise.
|
||||
func (first *element) isEqual(second *element) bool {
|
||||
return (first.index == second.index) &&
|
||||
(&first.hash).IsEqual(&second.hash)
|
||||
func (e *element) isEqual(e2 *element) bool {
|
||||
return (e.index == e2.index) &&
|
||||
(&e.hash).IsEqual(&e2.hash)
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
@@ -18,7 +18,7 @@ func bitsToIndex(bs ...uint64) (index, error) {
|
||||
" 64")
|
||||
}
|
||||
|
||||
var res uint64 = 0
|
||||
var res uint64
|
||||
for i, e := range bs {
|
||||
if e != 1 && e != 0 {
|
||||
return 0, errors.New("wrong element, should be '0' or" +
|
||||
|
||||
@@ -45,7 +45,7 @@ func getPrefix(index index, position uint8) uint64 {
|
||||
// | 0 | 1 | 1 | 1 |
|
||||
// + -- + ----- + ---- + ------ +
|
||||
|
||||
var zero uint64 = 0
|
||||
var zero uint64
|
||||
mask := (zero - 1) - uint64((1<<position)-1)
|
||||
return (uint64(index) & mask)
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func getPrefix(index index, position uint8) uint64 {
|
||||
// countTrailingZeros count number of of trailing zero bits, this function is
|
||||
// used to determine the number of element bucket.
|
||||
func countTrailingZeros(index index) uint8 {
|
||||
var zeros uint8 = 0
|
||||
var zeros uint8
|
||||
for ; zeros < maxHeight; zeros++ {
|
||||
|
||||
if getBit(index, zeros) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user