diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2024-11-11 21:39:32 +0100 |
|---|---|---|
| committer | наб <nabijaczleweli@nabijaczleweli.xyz> | 2024-11-11 21:40:20 +0100 |
| commit | dce938527ac064955a0fb04172635127c9e2fe98 (patch) | |
| tree | 3e9a0e001254f487d0d1a57c45bd5cd2a63af943 /apt-pkg | |
| parent | aefccbe09722c6a7a0911cb882622c96215eeec2 (diff) | |
FileFd::Open: don't needlessly copy filename in three-arg constructor
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/contrib/fileutl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 11f4871f6..db29ad71c 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -134,8 +134,8 @@ class APT_PUBLIC FileFd bool Open(std::string FileName,unsigned int const Mode,CompressMode Compress,unsigned long const AccessMode = 0666); bool Open(std::string FileName,unsigned int const Mode,APT::Configuration::Compressor const &compressor,unsigned long const AccessMode = 0666); - inline bool Open(std::string const &FileName,unsigned int const Mode, unsigned long const AccessMode = 0666) { - return Open(FileName, Mode, None, AccessMode); + inline bool Open(std::string FileName,unsigned int const Mode, unsigned long const AccessMode = 0666) { + return Open(std::move(FileName), Mode, None, AccessMode); }; bool OpenDescriptor(int Fd, unsigned int const Mode, CompressMode Compress, bool AutoClose=false); bool OpenDescriptor(int Fd, unsigned int const Mode, APT::Configuration::Compressor const &compressor, bool AutoClose=false); |
