Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame] | 1 | package common |
2 | |||||
3 | import ( | ||||
4 | "github.com/opencord/voltha/protos/go/openflow_13" | ||||
5 | ) | ||||
6 | |||||
7 | type SortByPriority []*openflow_13.OfpFlowStats | ||||
8 | |||||
9 | func (s SortByPriority) Len() int { | ||||
10 | return len(s) | ||||
11 | } | ||||
12 | func (s SortByPriority) Swap(i, j int) { | ||||
13 | s[i], s[j] = s[j], s[i] | ||||
14 | } | ||||
15 | func (s SortByPriority) Less(i, j int) bool { | ||||
16 | return s[i].Priority < s[j].Priority | ||||
17 | } |