diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2024-11-12 17:59:24 +0100 |
|---|---|---|
| committer | наб <nabijaczleweli@nabijaczleweli.xyz> | 2024-11-12 20:36:18 +0100 |
| commit | 06d2c2c2d484ce00821a3085a600b11254aa651e (patch) | |
| tree | 9429007cdd57fce7314e832131d30a07101d52a4 /apt-pkg/policy.cc | |
| parent | 70b02c17f3cec9f98fbffa9c560b06bb6e01c13f (diff) | |
apt-pkg/policy.cc: prepare for APT::StringView -> std::string_view
Diffstat (limited to 'apt-pkg/policy.cc')
| -rw-r--r-- | apt-pkg/policy.cc | 7 |
1 files changed, 3 insertions, 4 deletions
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 <apt-pkg/fileutl.h> #include <apt-pkg/pkgcache.h> #include <apt-pkg/policy.h> -#include <apt-pkg/string_view.h> #include <apt-pkg/strutl.h> #include <apt-pkg/tagfile-keys.h> #include <apt-pkg/tagfile.h> @@ -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()) { |
