From 250ad041e5eacc5d1c9709fff2e596ae67ebb87b Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 13 Oct 2025 13:09:12 +0200 Subject: [PATCH] Revert variable addition --- p2p/enode/node.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/p2p/enode/node.go b/p2p/enode/node.go index 5ea8d288ec..8198050353 100644 --- a/p2p/enode/node.go +++ b/p2p/enode/node.go @@ -373,10 +373,8 @@ func DistCmp(target, a, b ID) int { // LogDist returns the logarithmic distance between a and b, log2(a ^ b). func LogDist(a, b ID) int { - lenA := len(a) - totalBits := lenA * 8 lz := 0 - for i := 0; i < lenA; i += 8 { + for i := 0; i < len(a); i += 8 { ai := binary.BigEndian.Uint64(a[i : i+8]) bi := binary.BigEndian.Uint64(b[i : i+8]) x := ai ^ bi @@ -387,5 +385,5 @@ func LogDist(a, b ID) int { break } } - return totalBits - lz + return len(a)*8 - lz }