[Git][NTPsec/ntpsec][master] Correct reversal of sort order in MRU list.
Eric S. Raymond
gitlab at mg.gitlab.com
Fri Nov 25 15:43:12 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
40b917a9 by Eric S. Raymond at 2016-11-25T09:46:57-05:00
Correct reversal of sort order in MRU list.
- - - - -
1 changed file:
- pylib/packet.py
Changes:
=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1137,16 +1137,18 @@ class ControlSession:
if "sort" in variables:
sorter = variables["sort"]
del variables["sort"]
+ # Earliest elements in a span get displayed first, so these
+ # sorts are all sign-reversed from what you might expect.
# FIXME: implement sorting by address, in case anyone cares
sortdict = {
- "lstint" : lambda e: e.last, # lstint ascending
- "-lstint" : lambda e: -e.last, # lstint descending
- "avgint" : lambda e: e.avgint(), # avgint ascending
- "-avgint" : lambda e: -e.avgint(), # avgint descending
+ "lstint" : lambda e: -e.last, # lstint ascending
+ "-lstint" : lambda e: e.last, # lstint descending
+ "avgint" : lambda e: -e.avgint(), # avgint ascending
+ "-avgint" : lambda e: e.avgint(), # avgint descending
"addr" : None, # IPv4 asc. then IPv6 asc.
"-addr" : None, # IPv6 desc. then IPv4 desc.
- "count" : lambda e: e.ct, # hit count ascending
- "-count": lambda e: -e.ct, # hit count descending
+ "count" : lambda e: -e.ct, # hit count ascending
+ "-count": lambda e: e.ct, # hit count descending
}
if sorter == "listint":
sorter = None
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/40b917a965178ebeac05c3682c03f8dbfff6e969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161125/16297871/attachment.html>
More information about the vc
mailing list