From 0b156cd1711a5e27643b941f5a321a62e5a9b628 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 28 Mar 2022 18:05:44 +0200 Subject: 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. --- apt-pkg/tagfile.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/tagfile.cc') 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) { -- cgit v1.2.3-70-g09d2