diff options
author | vince <vincetiu8@gmail.com> | 2020-07-26 15:52:29 +0800 |
---|---|---|
committer | vince <vincetiu8@gmail.com> | 2020-08-20 14:06:18 +0800 |
commit | 6efada43e73c40e0c76c441f84cf02cc00d3eb1b (patch) | |
tree | ae1aef821a8447d299ad9d1afc25809f4ccde3f8 /bug | |
parent | 88c28db99851e7f5cceed6544759d37ac87a34d4 (diff) | |
download | git-bug-6efada43e73c40e0c76c441f84cf02cc00d3eb1b.tar.gz |
Implement the LRU Cache
Diffstat (limited to 'bug')
-rw-r--r-- | bug/bug.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -749,3 +749,22 @@ func (bug *Bug) Compile() Snapshot { return snap } + +// EquivalentBug returns true if two bugs are equal +func EquivalentBug(expected, actual *Bug) bool { + if len(expected.packs) != len(actual.packs) { + return false + } + + for i := range expected.packs { + for j := range expected.packs[i].Operations { + actual.packs[i].Operations[j].base().id = expected.packs[i].Operations[j].base().id + } + } + + if expected != actual { + return false + } + + return true +} |