diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2022-03-28 18:05:44 +0200 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2022-04-01 14:16:19 +0200 |
| commit | 0b156cd1711a5e27643b941f5a321a62e5a9b628 (patch) | |
| tree | 53b26d4b87c6a41c6e65d419b85676c0fe9c15de /apt-pkg/tagfile.cc | |
| parent | ba95ef53cf09b7f45c2ef9a39c0c158b7d79a88e (diff) | |
Avoid .c_str() on strings feed into pkgTagSection::FindS
FindS has a APT::StringView based API nowadays, so we can avoid these
explicit calls also allowing us to avoid the std::string in input or
output entirely or at least move it a few branches down.
Diffstat (limited to 'apt-pkg/tagfile.cc')
| -rw-r--r-- | apt-pkg/tagfile.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 52000c6b9..ebad1a4c5 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -1051,8 +1051,8 @@ bool pkgTagSection::Write(FileFd &File, char const * const * const Order, std::v { if (R->Action == Tag::REMOVE) continue; - std::string const name = ((R->Action == Tag::RENAME) ? R->Data : R->Name); - if (Exists(name.c_str())) + auto const name = ((R->Action == Tag::RENAME) ? R->Data : R->Name); + if (Exists(name)) continue; if (Order != NULL) { |
