]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/nice.go
Logging refactoring, no centralized humanizer
[nncp.git] / src / nice.go
index eceb6fc854be842c5568247a70d15241d4c38c86..7682a791e3ca83bccc65d3bd58803e2b06fb98d0 100644 (file)
@@ -106,3 +106,17 @@ func NicenessFmt(nice uint8) string {
        }
        return strconv.Itoa(int(nice))
 }
+
+type ByNice []*SPInfo
+
+func (a ByNice) Len() int {
+       return len(a)
+}
+
+func (a ByNice) Swap(i, j int) {
+       a[i], a[j] = a[j], a[i]
+}
+
+func (a ByNice) Less(i, j int) bool {
+       return a[i].Nice < a[j].Nice
+}