Commit 2cb8bd4d authored by hannahhoward's avatar hannahhoward

Move defer to correct position

parent 83086b56
...@@ -38,8 +38,8 @@ func (d *delay) Set(t time.Duration) time.Duration { ...@@ -38,8 +38,8 @@ func (d *delay) Set(t time.Duration) time.Duration {
func (d *delay) Wait() { func (d *delay) Wait() {
nextWaitTime := d.NextWaitTime() nextWaitTime := d.NextWaitTime()
d.l.RLock() d.l.RLock()
time.Sleep(nextWaitTime)
defer d.l.RUnlock() defer d.l.RUnlock()
time.Sleep(nextWaitTime)
} }
func (d *delay) NextWaitTime() time.Duration { func (d *delay) NextWaitTime() time.Duration {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment