From 06d2c2c2d484ce00821a3085a600b11254aa651e Mon Sep 17 00:00:00 2001 From: наб Date: Tue, 12 Nov 2024 17:59:24 +0100 Subject: apt-pkg/policy.cc: prepare for APT::StringView -> std::string_view --- apt-pkg/policy.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apt-pkg/policy.cc') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 5d361af1a..a54f04db6 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -438,13 +437,13 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) if (Name.empty()) return _error->Error(_("Invalid record in the preferences file %s, no Package header"), File.c_str()); if (Name == "*") - Name = APT::StringView{}; + Name = {}; const char *Start; const char *End; if (Tags.Find("Pin",Start,End) == false) continue; - + const char *Word = Start; for (; Word != End && isspace(*Word) == 0; Word++); @@ -490,7 +489,7 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) return _error->Error(_("No priority (or zero) specified for pin")); } - std::istringstream s(Name.to_string()); + std::istringstream s(std::string{Name}); // TODO: replace with std::string_view_stream in C++23 string pkg; while(!s.eof()) { -- cgit v1.2.3-70-g09d2