浏览代码

Merge pull request #1235 from onesafe/master

fix deleteLease
Rajat Chopra 5 年之前
父节点
当前提交
0672e0b6c5
共有 1 个文件被更改,包括 2 次插入2 次删除
  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