From 1bf268cebc84a9de1e538cbb54bcc0f434022192 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Fri, 28 Sep 2018 20:39:39 +0200 Subject: merge package operations into bug, they are tightly coupled anyway --- bug/bug.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bug/bug.go') diff --git a/bug/bug.go b/bug/bug.go index 993d3d7c..b252b176 100644 --- a/bug/bug.go +++ b/bug/bug.go @@ -300,7 +300,7 @@ func (bug *Bug) Validate() error { // The very first Op should be a CreateOp firstOp := bug.FirstOp() - if firstOp == nil || firstOp.OpType() != CreateOp { + if firstOp == nil || firstOp.base().OperationType != CreateOp { return fmt.Errorf("first operation should be a Create op") } @@ -308,7 +308,7 @@ func (bug *Bug) Validate() error { it := NewOperationIterator(bug) createCount := 0 for it.Next() { - if it.Value().OpType() == CreateOp { + if it.Value().base().OperationType == CreateOp { createCount++ } } -- cgit From 41e61a67b63e4d6c517005cf6f427115a664bdb5 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 29 Sep 2018 11:28:18 +0200 Subject: bug: apply an operation with a pointer to the snapshot --- bug/bug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bug/bug.go') diff --git a/bug/bug.go b/bug/bug.go index b252b176..f29c04b4 100644 --- a/bug/bug.go +++ b/bug/bug.go @@ -641,7 +641,7 @@ func (bug *Bug) Compile() Snapshot { for it.Next() { op := it.Value() - snap = op.Apply(snap) + op.Apply(&snap) snap.Operations = append(snap.Operations, op) } -- cgit