Browse Source

Merge pull request #1235 from onesafe/master

fix deleteLease
Rajat Chopra 5 years ago
parent
commit
0672e0b6c5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      subnet/watch.go

+ 2 - 2
subnet/watch.go

@@ -150,8 +150,8 @@ func (lw *leaseWatcher) remove(lease *Lease) Event {
 }
 
 func deleteLease(l []Lease, i int) []Lease {
-	l[i] = l[len(l)-1]
-	return l[:len(l)-1]
+	l = append(l[:i], l[i+1:]...)
+	return l
 }
 
 // WatchLease performs a long term watch of the given network's subnet lease