aboutsummaryrefslogtreecommitdiff
path: root/external_test.go
diff options
context:
space:
mode:
authorChris Wendt <chrismwendt@gmail.com>2022-06-08 03:18:43 -0600
committerChris Wendt <chrismwendt@gmail.com>2022-06-08 03:18:43 -0600
commita7900ffa1ba5655a5fad903c6634c888d3025d86 (patch)
treeacf1109fc14aba8578b1972bfd6a477842f5e2e0 /external_test.go
parentremove unreachable code (diff)
downloadstm-a7900ffa1ba5655a5fad903c6634c888d3025d86.tar.gz
stm-a7900ffa1ba5655a5fad903c6634c888d3025d86.tar.xz
eliminate some type assertions
Diffstat (limited to 'external_test.go')
-rw-r--r--external_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/external_test.go b/external_test.go
index 201712d..a56aeee 100644
--- a/external_test.go
+++ b/external_test.go
@@ -78,14 +78,14 @@ func BenchmarkThunderingHerd(b *testing.B) {
}()
}
go func() {
- for stm.Atomically(func(tx *stm.Tx) interface{} {
+ for stm.Atomically(func(tx *stm.Tx) bool {
if done.Get(tx) {
return false
}
tx.Assert(tokens.Get(tx) < maxTokens)
tokens.Set(tx, tokens.Get(tx)+1)
return true
- }).(bool) {
+ }) {
}
}()
stm.Atomically(stm.VoidOperation(func(tx *stm.Tx) {
@@ -118,18 +118,18 @@ func BenchmarkInvertedThunderingHerd(b *testing.B) {
}()
}
go func() {
- for stm.Atomically(func(tx *stm.Tx) interface{} {
+ for stm.Atomically(func(tx *stm.Tx) bool {
if done.Get(tx) {
return false
}
tx.Assert(tokens.Get(tx) < maxTokens)
tokens.Set(tx, tokens.Get(tx)+1)
return true
- }).(bool) {
+ }) {
}
}()
go func() {
- for stm.Atomically(func(tx *stm.Tx) interface{} {
+ for stm.Atomically(func(tx *stm.Tx) bool {
tx.Assert(tokens.Get(tx) > 0)
tokens.Set(tx, tokens.Get(tx)-1)
pending.Get(tx).Range(func(i interface{}) bool {
@@ -141,7 +141,7 @@ func BenchmarkInvertedThunderingHerd(b *testing.B) {
return true
})
return !done.Get(tx)
- }).(bool) {
+ }) {
}
}()
stm.Atomically(stm.VoidOperation(func(tx *stm.Tx) {