Author: damoxc

Revision: 6167

Log:
        fix the ip address sort function

Diff:
Modified: trunk/deluge/ui/web/js/deluge-all/Deluge.Details.Peers.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-all/Deluge.Details.Peers.js   2010-01-29 
15:35:51 UTC (rev 6166)
+++ trunk/deluge/ui/web/js/deluge-all/Deluge.Details.Peers.js   2010-01-29 
16:40:49 UTC (rev 6167)
@@ -46,15 +46,8 @@
                return Deluge.progressBar(progress, width, progress + '%');
        }
        function sort_address(value) {
-               var m = 
value.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);
-               var address = 0;
-               var parts = [m[1], m[2], m[3], m[4]];
-               Ext.each(parts, function(part, index) {
-                       part = parseInt(part);
-                       address = address | part << ((3 - index) * 8);
-                       //alert("Total: " + address + "\nPart: " + part + 
"\nIndex: " + index + "\nCalc: " + (part << ((3 - index) * 8)));
-               });
-               return address;
+               var d = 
value.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);
+               return ((((((+d[1])*256)+(+d[2]))*256)+(+d[3]))*256)+(+d[4]);
        }
 
        Ext.deluge.details.PeersTab = Ext.extend(Ext.grid.GridPanel, {
@@ -144,4 +137,4 @@
                }
        });
        Deluge.Details.add(new Ext.deluge.details.PeersTab());
-})();
\ No newline at end of file
+})();


-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to