- bool operator () (const pkgCache::VerIterator &v_lhs,
- const pkgCache::VerIterator &v_rhs)
+ const pkgCache::VerIterator iter;
+ const pkgCache::DescFile * descFile;
+public:
+ VerIteratorWithCaching(const pkgCache::VerIterator& iter) :
+ iter(iter),
+ descFile(iter->DescriptionList != 0
+ ? (const pkgCache::DescFile *) iter.TranslatedDescription().FileList()
+ : nullptr)
+ {}
+ const pkgCache::DescFile * CachedDescFile() const { return descFile; }
+ operator pkgCache::VerIterator() const { return iter; }
+};
+
+struct VersionSortDescriptionLocality /*{{{*/
+{
+ bool operator () (const VerIteratorWithCaching &v_lhs,
+ const VerIteratorWithCaching &v_rhs)