From 02ceb810fe0de9b267a8b6a302505967afce6b5a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 26 Jan 2016 21:58:57 +0100 Subject: [PATCH] remove unused Description methods in listparsers These virtual methods are implemented in hidden classes, so we can drop them without breaking the ABI. Git-Dch: Ignore --- apt-pkg/deb/deblistparser.cc | 20 +------------------- apt-pkg/deb/deblistparser.h | 4 ---- apt-pkg/edsp/edsplistparser.cc | 8 ++------ apt-pkg/edsp/edsplistparser.h | 3 +-- apt-pkg/pkgcachegen.h | 1 - 5 files changed, 4 insertions(+), 32 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 63343005b..86fd5dc54 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -235,24 +235,6 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) return true; } /*}}}*/ -// ListParser::Description - Return the description string /*{{{*/ -// --------------------------------------------------------------------- -/* This is to return the string describing the package in debian - form. If this returns the blank string then the entry is assumed to - only describe package properties */ -string debListParser::Description(std::string const &lang) -{ - return Description(StringView(lang)).to_string(); -} - -StringView debListParser::Description(StringView lang) -{ - if (lang.empty()) - return Section.Find("Description"); - else - return Section.Find(string("Description-").append(lang.data(), lang.size())); -} - /*}}}*/ // ListParser::AvailableDescriptionLanguages /*{{{*/ std::vector debListParser::AvailableDescriptionLanguages() { @@ -287,7 +269,7 @@ MD5SumValue debListParser::Description_md5() StringView const value = Section.Find("Description-md5"); if (value.empty() == true) { - StringView const desc = Description(StringView()); + StringView const desc = Section.Find("Description"); if (desc == "\n") return MD5SumValue(); diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 4663c0119..1c5275e0a 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -73,10 +73,6 @@ class APT_HIDDEN debListParser : public pkgCacheListParser virtual bool ArchitectureAll() APT_OVERRIDE; virtual std::string Version() APT_OVERRIDE; virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; - virtual std::string Description(std::string const &lang) APT_OVERRIDE; -#ifdef APT_PKG_EXPOSE_STRING_VIEW - APT::StringView Description(APT::StringView lang); -#endif virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; virtual MD5SumValue Description_md5() APT_OVERRIDE; virtual unsigned short VersionHash() APT_OVERRIDE; diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index 85a57479e..82799205e 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -54,13 +54,9 @@ bool edspListParser::NewVersion(pkgCache::VerIterator &Ver) // ListParser::Description - Return the description string /*{{{*/ // --------------------------------------------------------------------- /* Sorry, no description for the resolvers… */ -std::string edspListParser::Description() +std::vector edspListParser::AvailableDescriptionLanguages() { - return ""; -} -std::string edspListParser::DescriptionLanguage() -{ - return ""; + return {}; } MD5SumValue edspListParser::Description_md5() { diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 25363e1c7..691ac83ed 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -31,8 +31,7 @@ class APT_HIDDEN edspListParser : public debListParser edspListParserPrivate * const d; public: virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; - virtual std::string Description(); - virtual std::string DescriptionLanguage(); + virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; virtual MD5SumValue Description_md5() APT_OVERRIDE; virtual unsigned short VersionHash() APT_OVERRIDE; diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index f22a2df4e..a3de37a60 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -213,7 +213,6 @@ class APT_HIDDEN pkgCacheListParser virtual bool ArchitectureAll() = 0; virtual std::string Version() = 0; virtual bool NewVersion(pkgCache::VerIterator &Ver) = 0; - virtual std::string Description(std::string const &lang) = 0; virtual std::vector AvailableDescriptionLanguages() = 0; virtual MD5SumValue Description_md5() = 0; virtual unsigned short VersionHash() = 0; -- 2.45.2