aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
authorChris Wendt <chrismwendt@gmail.com>2022-06-08 01:35:20 -0600
committerChris Wendt <chrismwendt@gmail.com>2022-06-08 01:35:20 -0600
commit53b98cfddef7afcb79d8a1b35fb186b58426c1d4 (patch)
tree377c94fe85502b2525615dbc51d68d6a3ec0e1e9 /tx.go
parentgo mod tidy (diff)
downloadstm-53b98cfddef7afcb79d8a1b35fb186b58426c1d4.tar.gz
stm-53b98cfddef7afcb79d8a1b35fb186b58426c1d4.tar.xz
use generic atomic
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tx.go b/tx.go
index 9be08b5..3cd0301 100644
--- a/tx.go
+++ b/tx.go
@@ -24,7 +24,7 @@ type Tx struct {
// Check that none of the logged values have changed since the transaction began.
func (tx *Tx) inputsChanged() bool {
for v, read := range tx.reads {
- if read.Changed(v.value.Load().(VarValue)) {
+ if read.Changed(v.value.Load()) {
return true
}
}
@@ -84,7 +84,7 @@ func (tx *Tx) Get(v *Var) interface{} {
// If we haven't previously read v, record its version
vv, ok := tx.reads[v]
if !ok {
- vv = v.value.Load().(VarValue)
+ vv = v.value.Load()
tx.reads[v] = vv
}
return vv.Get()