summaryrefslogtreecommitdiff
path: root/python/pkgmanager.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-04-15 14:16:28 +0200
committerJulian Andres Klode <jak@debian.org>2009-04-15 14:16:28 +0200
commit2b867aebe32d59b7450f3a7fb22390e0dd9f8cc7 (patch)
tree49d4d5ec7e109dfe55d51ffd2061c96ec18bd5da /python/pkgmanager.cc
parent3caa05aa8e295d338be4bfbe7fdd2e825a59d947 (diff)
downloadpython-apt-2b867aebe32d59b7450f3a7fb22390e0dd9f8cc7.tar.gz
* apt/cache.py: Use set() and WeakValueDictionary() for holding packages.
Only create Package objects when they are requested, do not keep them in a dict. Saves 10MB for 25,000 packages on my machine. The set holds the names of all packages which have at least one version, and the WeakValueDictionary() holds weak references to created Package objects. This way accessing the same package two times should return the same object, kept by the WeakValueDictionary().
Diffstat (limited to 'python/pkgmanager.cc')
0 files changed, 0 insertions, 0 deletions