Prevented the use of reflect and instead compared the TaskIDs of the tasks.

This commit is contained in:
Pradyumna Kaushik 2016-11-28 20:02:03 -05:00 committed by Renan DelValle
parent 1c8265b87b
commit 6289b8954d

View file

@ -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
}
}