From 2f7c1cc3da61ea09aa602e3dda232772bb2ca926 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 30 Jan 2015 13:37:18 +1100 Subject: [PATCH] webdav: remove unnecessary "n.byExpiryIndex = -1". These occur after a heap.Remove call, and heap.Remove calls byExpiry.Pop, which already sets n.byExpiryIndex to -1. The memLS.consistent method in lock_test.go checks that the expiry fields are all consistent. Change-Id: I09f5d02999e4635f15d1723f89a86b951ed95950 Reviewed-on: https://go-review.googlesource.com/3563 Reviewed-by: Dave Cheney Reviewed-by: Nick Cooper --- webdav/lock.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/webdav/lock.go b/webdav/lock.go index 4bc4465d..a5634e7e 100644 --- a/webdav/lock.go +++ b/webdav/lock.go @@ -193,7 +193,6 @@ func (m *memLS) Refresh(now time.Time, token string, duration time.Duration) (Lo } if n.byExpiryIndex >= 0 { heap.Remove(&m.byExpiry, n.byExpiryIndex) - n.byExpiryIndex = -1 } n.details.Duration = duration if n.details.Duration >= 0 { @@ -277,7 +276,6 @@ func (m *memLS) remove(n *memLSNode) { }) if n.byExpiryIndex >= 0 { heap.Remove(&m.byExpiry, n.byExpiryIndex) - n.byExpiryIndex = -1 } }