From 6289b8954d5ac80b517e345e9f706721cffe9209 Mon Sep 17 00:00:00 2001 From: Pradyumna Kaushik Date: Mon, 28 Nov 2016 20:02:03 -0500 Subject: [PATCH] Prevented the use of reflect and instead compared the TaskIDs of the tasks. --- def/task.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/def/task.go b/def/task.go index 9699812..e52acb3 100644 --- a/def/task.go +++ b/def/task.go @@ -5,7 +5,6 @@ import ( "encoding/json" "github.com/pkg/errors" "os" - "reflect" ) type Task struct { @@ -85,15 +84,9 @@ func Compare(task1 *Task, task2 *Task) bool { if task1 == task2 { return true } - // Checking member equality - if reflect.DeepEqual(*task1, *task2) { - // Need to check for the task ID - if task1.TaskID == task2.TaskID { - return true - } else { - return false - } - } else { + if task1.TaskID != task2.TaskID { return false + } else { + return true } }