From 98fe6924ffad34afef3be56377858fe87afbdfa0 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 27 Oct 2022 09:34:50 +1100 Subject: Mostly fix compatibility with immutable v0.4.0 List has to be dropped because type aliases are not allowed for generic types. There's an outstanding issue that Set can't contain pointer values. https://github.com/benbjohnson/immutable/issues/25 I would abandon this package altogether, but there's no Set type in immutable, and its comparer and hasher types are more boilerplate than I want. --- external_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'external_test.go') diff --git a/external_test.go b/external_test.go index abdf544..1291cce 100644 --- a/external_test.go +++ b/external_test.go @@ -99,7 +99,7 @@ func BenchmarkInvertedThunderingHerd(b *testing.B) { for i := 0; i < b.N; i++ { done := stm.NewBuiltinEqVar(false) tokens := stm.NewBuiltinEqVar(0) - pending := stm.NewVar(stmutil.NewSet()) + pending := stm.NewVar(stmutil.NewSet[*stm.Var[bool]]()) for range iter.N(1000) { ready := stm.NewVar(false) stm.Atomically(stm.VoidOperation(func(tx *stm.Tx) { @@ -132,8 +132,7 @@ func BenchmarkInvertedThunderingHerd(b *testing.B) { 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 any) bool { - ready := i.(*stm.Var[bool]) + pending.Get(tx).Range(func(ready *stm.Var[bool]) bool { if !ready.Get(tx) { ready.Set(tx, true) return false -- cgit v1.2.3