Ignore:
Timestamp:
02/20/14 13:46:04 (7 years ago)
Author:
gkronber
Message:

#2127: removed Equals() and GetHashCode() overrides as well as related static methods.
Changed ctors of Task and Job to prevent calling virtual members.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/ScheduledTask.cs

    r9456 r10476  
    7575      return sb.ToString();
    7676    }
    77 
    78     public override bool Equals(object obj) {
    79       if (obj.GetType() == typeof(ScheduledTask))
    80         return AreEqual(this, obj as ScheduledTask);
    81       else
    82         return false;
    83     }
    84 
    85     public override int GetHashCode() {
    86       return TaskNr ^ JobNr;
    87     }
    88 
    89     public static bool AreEqual(ScheduledTask task1, ScheduledTask task2) {
    90       return (
    91         task1.TaskNr == task2.TaskNr &&
    92         task1.Duration == task2.Duration &&
    93         task1.JobNr == task2.JobNr &&
    94         task1.ResourceNr == task2.ResourceNr &&
    95         task1.StartTime == task2.StartTime &&
    96         task1.EndTime == task2.EndTime);
    97     }
    9877  }
    9978}
Note: See TracChangeset for help on using the changeset viewer.