aboutsummaryrefslogtreecommitdiffstats
path: root/bug/with_snapshot.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-29 11:28:18 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-29 11:28:18 +0200
commit41e61a67b63e4d6c517005cf6f427115a664bdb5 (patch)
tree889066eab537b19ad41196b47d803a9d5a3f031e /bug/with_snapshot.go
parent794d014fae9a78bd8664e6628a20902bd6dc767a (diff)
downloadgit-bug-41e61a67b63e4d6c517005cf6f427115a664bdb5.tar.gz
bug: apply an operation with a pointer to the snapshot
Diffstat (limited to 'bug/with_snapshot.go')
-rw-r--r--bug/with_snapshot.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/bug/with_snapshot.go b/bug/with_snapshot.go
index 48274ed5..2b2439df 100644
--- a/bug/with_snapshot.go
+++ b/bug/with_snapshot.go
@@ -27,10 +27,8 @@ func (b *WithSnapshot) Append(op Operation) {
return
}
- snap := op.Apply(*b.snap)
- snap.Operations = append(snap.Operations, op)
-
- b.snap = &snap
+ op.Apply(b.snap)
+ b.snap.Operations = append(b.snap.Operations, op)
}
// Commit intercept Bug.Commit() to update the snapshot efficiently