diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-30 17:15:54 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-30 17:15:54 +0200 |
commit | 7f86898ef9a8f9e866835ece3c9824a8edc58036 (patch) | |
tree | 5c5733c9272f3477317935bde6ecb4680276b717 /bug/op_edit_comment.go | |
parent | d71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (diff) | |
download | git-bug-7f86898ef9a8f9e866835ece3c9824a8edc58036.tar.gz |
bug: use deditated type for all TimelineItem
Diffstat (limited to 'bug/op_edit_comment.go')
-rw-r--r-- | bug/op_edit_comment.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/bug/op_edit_comment.go b/bug/op_edit_comment.go index cb4a2216..78976af7 100644 --- a/bug/op_edit_comment.go +++ b/bug/op_edit_comment.go @@ -33,12 +33,7 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) { var commentIndex int for i, item := range snapshot.Timeline { - h, err := item.Hash() - - if err != nil { - // Should never happen, we control what goes into the timeline - panic(err) - } + h := item.Hash() if h == op.Target { target = snapshot.Timeline[i] @@ -68,8 +63,8 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) { item := target.(*CreateTimelineItem) item.Append(comment) - case *CommentTimelineItem: - item := target.(*CommentTimelineItem) + case *AddCommentTimelineItem: + item := target.(*AddCommentTimelineItem) item.Append(comment) } |