mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-25 21:48:23 +01:00
routing: pre-allocate the distance map to an estimated node count
Pre-sizing these structures avoids a lot of map resizing, which causes copies and rehashing of entries. We mostly know that the map won't exceed that size, and it doesn't affect memory usage in any significant way.
This commit is contained in:
@@ -17,7 +17,7 @@ func TestHeapOrdering(t *testing.T) {
|
||||
|
||||
// First, create a blank heap, we'll use this to push on randomly
|
||||
// generated items.
|
||||
nodeHeap := newDistanceHeap()
|
||||
nodeHeap := newDistanceHeap(0)
|
||||
|
||||
prand.Seed(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user