Commits

murarth committed 6bea729

sort.Interface methods for Event no longer take pointer receiver

Comments (0)

Files changed (1)

 
 func (ev *Event) AddHandler(handler EventHandler) {
 	*ev = append(*ev, handler)
-	sort.Sort(ev)
+	sort.Sort(*ev)
 }
 
-func (ev *Event) Len() int {
-	return len(*ev)
+func (ev Event) Len() int {
+	return len(ev)
 }
 
-func (ev *Event) Less(i, j int) bool {
-	return (*ev)[i].Prioritize() < (*ev)[j].Prioritize()
+func (ev Event) Less(i, j int) bool {
+	return ev[i].Prioritize() < ev[j].Prioritize()
 }
 
-func (ev *Event) Swap(i, j int) {
-	(*ev)[i], (*ev)[j] = (*ev)[j], (*ev)[i]
+func (ev Event) Swap(i, j int) {
+	ev[i], ev[j] = ev[j], ev[i]
 }
 
 var (