From 472376be6818b5ea43250abcbecfcab53b4a729a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 1 Apr 2022 13:45:09 +0200 Subject: Use pkgTagSection::Key in more places in src:apt The speed critical paths were converted earlier, but the remaining could benefit a tiny bit from this as well especially as we have the facility now available and can therefore brush up the code in various places in the process as well. Also takes the time to add the hidden Exists method advertised in the headers, but previously not implemented. --- cmdline/apt-sortpkgs.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmdline/apt-sortpkgs.cc') diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index da451708f..519825457 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -85,9 +86,9 @@ static bool DoIt(string InFile) /* Fetch the name, auto-detecting if this is a source file or a package file */ - Tmp.Name = Section.FindS("Package"); - Tmp.Ver = Section.FindS("Version"); - Tmp.Arch = Section.FindS("Architecture"); + Tmp.Name = Section.Find(pkgTagSection::Key::Package).to_string(); + Tmp.Ver = Section.Find(pkgTagSection::Key::Version).to_string(); + Tmp.Arch = Section.Find(pkgTagSection::Key::Architecture).to_string(); if (Tmp.Name.empty() == true) return _error->Error(_("Unknown package record!")); -- cgit v1.2.3-70-g09d2