From fa8deaef4ef0fb5dc558d783d28fa2be409d6348 Mon Sep 17 00:00:00 2001 From: Brian Cosgrove Date: Fri, 27 Apr 2018 10:08:15 -0500 Subject: [PATCH] lease: Clean-up old TODO around lease map and priority queue This TODO was addressed in #9418. --- lease/lessor.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lease/lessor.go b/lease/lessor.go index b274947f5c0..32b4ad3be17 100644 --- a/lease/lessor.go +++ b/lease/lessor.go @@ -123,12 +123,6 @@ type lessor struct { // demotec will be closed if the lessor is demoted. demotec chan struct{} - // TODO: probably this should be a heap with a secondary - // id index. - // Now it is O(N) to loop over the leases to find expired ones. - // We want to make Grant, Revoke, and findExpiredLeases all O(logN) and - // Renew O(1). - // findExpiredLeases and Renew should be the most frequent operations. leaseMap map[LeaseID]*Lease leaseHeap LeaseQueue itemMap map[LeaseItem]LeaseID