From 4cfcc11e206cda21ffd3ff7c7413bac088a5cdc6 Mon Sep 17 00:00:00 2001 From: bytedream Date: Thu, 23 Jun 2022 17:00:46 +0200 Subject: [PATCH] Simplified 'Liked' --- comment.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/comment.go b/comment.go index dc68201..333ec4b 100644 --- a/comment.go +++ b/comment.go @@ -145,12 +145,7 @@ func (c *Comment) Like() error { // Liked returns if the user has liked the comment. func (c *Comment) Liked() bool { - for _, flag := range c.Flags { - if flag == "liked" { - return true - } - } - return false + return c.markedAs("liked") } // RemoveLike removes the like from the comment. Works only if the user has liked it.