Author: dmeyer
Date: Sun Apr 23 11:02:44 2006
New Revision: 1484
Modified:
trunk/beacon/src/db.py
Log:
remove one sort and add some doc
Modified: trunk/beacon/src/db.py
==============================================================================
--- trunk/beacon/src/db.py (original)
+++ trunk/beacon/src/db.py Sun Apr 23 11:02:44 2006
@@ -320,8 +320,8 @@
items.append(create_dir(i, parent))
else:
items.append(create_file(i, parent))
- # sort items based on url. The listdir is also sorted, that makes
- # checking much faster
+ # sort items based on name. The listdir is also sorted by name,
+ # that makes checking much faster
items.sort(lambda x,y: cmp(x._beacon_name, y._beacon_name))
# TODO: this could block for cdrom drives and network filesystems.
Maybe
@@ -377,7 +377,10 @@
if self.changes:
# need commit because some items were deleted from the db
self.commit()
- items.sort(lambda x,y: cmp(x.url, y.url))
+
+ # no need to sort the items again, they are already sorted based
+ # on name, let us keep it that way. And name is unique in a directory.
+ # items.sort(lambda x,y: cmp(x.url, y.url))
return items
@@ -504,7 +507,7 @@
# neither dir nor file, something else
result.append(create_item(r, parent))
- # sort results and return
+ # sort results by url (name is not unique) and return
result.sort(lambda x,y: cmp(x.url, y.url))
return result
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog