diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-04-15 14:16:28 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-04-15 14:16:28 +0200 |
| commit | 2b867aebe32d59b7450f3a7fb22390e0dd9f8cc7 (patch) | |
| tree | 49d4d5ec7e109dfe55d51ffd2061c96ec18bd5da /python/pkgmanager.cc | |
| parent | 3caa05aa8e295d338be4bfbe7fdd2e825a59d947 (diff) | |
| download | python-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
