projects
/
btrtrc.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b757b62
)
lockWithDeferreds: inlineable Unlock() (#603)
author
YenForYang <YenForYang@users.noreply.github.com>
Fri, 17 Sep 2021 03:08:00 +0000 (22:08 -0500)
committer
GitHub <noreply@github.com>
Fri, 17 Sep 2021 03:08:00 +0000 (13:08 +1000)
deferrwl.go
patch
|
blob
|
history
diff --git
a/deferrwl.go
b/deferrwl.go
index e8e90e87cef7dd751de076213ad87701ef3f94b1..bf95be244f064880a6117a1358304e5db634d1af 100644
(file)
--- a/
deferrwl.go
+++ b/
deferrwl.go
@@
-15,10
+15,11
@@
func (me *lockWithDeferreds) Lock() {
}
func (me *lockWithDeferreds) Unlock() {
- for _, a := range me.unlockActions {
- a()
+ unlockActions := me.unlockActions
+ for i := 0; i < len(unlockActions); i += 1 {
+ unlockActions[i]()
}
- me.unlockActions =
me.
unlockActions[:0]
+ me.unlockActions = unlockActions[:0]
me.internal.Unlock()
}