aboutsummaryrefslogtreecommitdiffstats
path: root/bug/snapshot.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-23 19:19:16 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-23 19:19:16 +0200
commite7648996c8f278d061fe03a5c4d255049da765e5 (patch)
tree2917891d130853b24a375ef00b68fe14c8228296 /bug/snapshot.go
parent16f55e3f4d560330a638986130d27fd067300169 (diff)
downloadgit-bug-e7648996c8f278d061fe03a5c4d255049da765e5.tar.gz
bug: add a new BugExerpt that hold a subset of a bug state for efficient sorting and retrieval
Diffstat (limited to 'bug/snapshot.go')
-rw-r--r--bug/snapshot.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/bug/snapshot.go b/bug/snapshot.go
index 7f1d6099..1ef4534b 100644
--- a/bug/snapshot.go
+++ b/bug/snapshot.go
@@ -37,10 +37,19 @@ func (snap Snapshot) Summary() string {
}
// Return the last time a bug was modified
-func (snap Snapshot) LastEdit() time.Time {
+func (snap Snapshot) LastEditTime() time.Time {
if len(snap.Operations) == 0 {
return time.Unix(0, 0)
}
return snap.Operations[len(snap.Operations)-1].Time()
}
+
+// Return the last timestamp a bug was modified
+func (snap Snapshot) LastEditUnix() int64 {
+ if len(snap.Operations) == 0 {
+ return 0
+ }
+
+ return snap.Operations[len(snap.Operations)-1].UnixTime()
+}