diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-13 21:21:24 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-13 21:21:24 +0200 |
commit | 1779a0f3b92d58654b43444addeaf437a64d77a8 (patch) | |
tree | 9f973413454894f0456d7379425070d468712242 /bug/operation_iterator.go | |
parent | 289f8d53ee960d35c1f0c42e8753ad536737b875 (diff) | |
download | git-bug-1779a0f3b92d58654b43444addeaf437a64d77a8.tar.gz |
serialize a Bug to git as a blob+tree+commit+ref
Diffstat (limited to 'bug/operation_iterator.go')
-rw-r--r-- | bug/operation_iterator.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bug/operation_iterator.go b/bug/operation_iterator.go index fe001d45..0df8b599 100644 --- a/bug/operation_iterator.go +++ b/bug/operation_iterator.go @@ -16,17 +16,17 @@ func NewOperationIterator(bug *Bug) *OperationIterator { func (it *OperationIterator) Next() bool { // Special case of the staging area - if it.packIndex == len(it.bug.Packs) { - pack := it.bug.Staging + if it.packIndex == len(it.bug.packs) { + pack := it.bug.staging it.opIndex++ return it.opIndex < len(pack.Operations) } - if it.packIndex >= len(it.bug.Packs) { + if it.packIndex >= len(it.bug.packs) { return false } - pack := it.bug.Packs[it.packIndex] + pack := it.bug.packs[it.packIndex] it.opIndex++ @@ -39,17 +39,17 @@ func (it *OperationIterator) Next() bool { it.packIndex++ // Special case of the non-empty staging area - if it.packIndex == len(it.bug.Packs) && len(it.bug.Staging.Operations) > 0 { + if it.packIndex == len(it.bug.packs) && len(it.bug.staging.Operations) > 0 { return true } - return it.packIndex < len(it.bug.Packs) + return it.packIndex < len(it.bug.packs) } func (it *OperationIterator) Value() Operation { // Special case of the staging area - if it.packIndex == len(it.bug.Packs) { - pack := it.bug.Staging + if it.packIndex == len(it.bug.packs) { + pack := it.bug.staging if it.opIndex >= len(pack.Operations) { panic("Iterator is not valid anymore") @@ -58,11 +58,11 @@ func (it *OperationIterator) Value() Operation { return pack.Operations[it.opIndex] } - if it.packIndex >= len(it.bug.Packs) { + if it.packIndex >= len(it.bug.packs) { panic("Iterator is not valid anymore") } - pack := it.bug.Packs[it.packIndex] + pack := it.bug.packs[it.packIndex] if it.opIndex >= len(pack.Operations) { panic("Iterator is not valid anymore") |