diff options
author | tobo <tobo@yandex-team.ru> | 2022-02-24 11:58:08 +0300 |
---|---|---|
committer | tobo <tobo@yandex-team.ru> | 2022-02-24 11:58:08 +0300 |
commit | 0cd396f47ddebe98614ce96b7b0394a0a892b7cc (patch) | |
tree | 11335611c65e163e7633020597acd396ca68450f /util/system/filemap.h | |
parent | 42f6e0ffddb92ca389ac4bcd01acb0caa905c6df (diff) | |
download | ydb-0cd396f47ddebe98614ce96b7b0394a0a892b7cc.tar.gz |
fix CLion perf warnings - use const references instead of passing by value
ref:e94e72a813a3aa41c543fd1d9f7d73f02cca8bc0
Diffstat (limited to 'util/system/filemap.h')
-rw-r--r-- | util/system/filemap.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/system/filemap.h b/util/system/filemap.h index 11be64bff4..edae96228b 100644 --- a/util/system/filemap.h +++ b/util/system/filemap.h @@ -64,7 +64,7 @@ struct TMemoryMapCommon { * Name that will be printed in exceptions if not specified. * Overridden by name obtained from `TFile` if it's not empty. */ - static TString UnknownFileName(); + static const TString& UnknownFileName(); }; Y_DECLARE_OPERATORS_FOR_FLAGS(TMemoryMapCommon::EOpenMode) @@ -75,8 +75,8 @@ public: TMemoryMap(const TString& name, i64 length, EOpenMode om); TMemoryMap(FILE* f, TString dbgName = UnknownFileName()); TMemoryMap(FILE* f, EOpenMode om, TString dbgName = UnknownFileName()); - TMemoryMap(const TFile& file, TString dbgName = UnknownFileName()); - TMemoryMap(const TFile& file, EOpenMode om, TString dbgName = UnknownFileName()); + TMemoryMap(const TFile& file, const TString& dbgName = UnknownFileName()); + TMemoryMap(const TFile& file, EOpenMode om, const TString& dbgName = UnknownFileName()); ~TMemoryMap(); @@ -113,7 +113,7 @@ public: TFileMap(const TString& name, EOpenMode om); TFileMap(const TString& name, i64 length, EOpenMode om); TFileMap(FILE* f, EOpenMode om = oRdOnly, TString dbgName = UnknownFileName()); - TFileMap(const TFile& file, EOpenMode om = oRdOnly, TString dbgName = UnknownFileName()); + TFileMap(const TFile& file, EOpenMode om = oRdOnly, const TString& dbgName = UnknownFileName()); TFileMap(const TFileMap& fm) noexcept; ~TFileMap(); @@ -293,10 +293,10 @@ public: ~TMappedAllocation() { Dealloc(); } - TMappedAllocation(TMappedAllocation&& other) { + TMappedAllocation(TMappedAllocation&& other) noexcept { this->swap(other); } - TMappedAllocation& operator=(TMappedAllocation&& other) { + TMappedAllocation& operator = (TMappedAllocation&& other)noexcept { this->swap(other); return *this; } @@ -317,7 +317,7 @@ public: size_t MappedSize() const { return Size_; } - void swap(TMappedAllocation& with); + void swap(TMappedAllocation& with) noexcept; private: void* Ptr_ = nullptr; |