Summary: | Sorting Peers by IP Address sorts incorrectly | ||
---|---|---|---|
Product: | [Applications] ktorrent | Reporter: | Ami Setton <asetton> |
Component: | general | Assignee: | Joris Guisson <joris.guisson> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Sort ip correctly in infowidget peerview |
Description
Ami Setton
2007-09-29 17:50:42 UTC
Created attachment 21881 [details]
Sort ip correctly in infowidget peerview
That's the first C++ patch I've done, so be critical. How else would I learn? :) Hey there, dvj. Firstly, thanks a lot for addressing the issue! I'll guess you meant that the bug assignee should check the patch...but, hey, I'll in throw my $0.02, just for fun. 1) What about just using inet_aton on both IPs and comparing the results? There might be a lo of back-and-forth about what's more expensive, but if you lost some lines of code, it might be worth any expense (_if_ it's more expensive.) 2) Did you mean "digits" in your variable names instead of "digets" ? It would be much faster to convert the string ones and then compare with converted value, much faster. Oops, typo : ones -> once SVN commit 727609 by guisson: Sort IP addresses by their actual value and not by their string representation BUG: 150328 M +11 -6 peerview.cpp M +1 -0 peerview.h WebSVN link: http://websvn.kde.org/?view=rev&revision=727609 Thanks, Joris! |