diff options
author | babenko <babenko@yandex-team.ru> | 2022-02-10 16:49:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:19 +0300 |
commit | cec37806d8847aa3db53bafc9e251d4aaf325c12 (patch) | |
tree | 4a61c191e93e31d9ab423e258c71ab43550ee3d2 /library/cpp/yt/misc/source_location.cpp | |
parent | 58cd0b86ed99a72df22479e26a20bc1c1e57e65e (diff) | |
download | ydb-cec37806d8847aa3db53bafc9e251d4aaf325c12.tar.gz |
Restoring authorship annotation for <babenko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yt/misc/source_location.cpp')
-rw-r--r-- | library/cpp/yt/misc/source_location.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/library/cpp/yt/misc/source_location.cpp b/library/cpp/yt/misc/source_location.cpp index 8d22d43636..c632378050 100644 --- a/library/cpp/yt/misc/source_location.cpp +++ b/library/cpp/yt/misc/source_location.cpp @@ -1,54 +1,54 @@ -#include "source_location.h" - -#include <string.h> - -namespace NYT { - -//////////////////////////////////////////////////////////////////////////////// - -const char* TSourceLocation::GetFileName() const -{ - return FileName_; -} - -int TSourceLocation::GetLine() const -{ - return Line_; -} - -bool TSourceLocation::IsValid() const -{ - return FileName_ != nullptr; -} - -bool TSourceLocation::operator<(const TSourceLocation& other) const -{ - const char* fileName = FileName_ ? FileName_ : ""; - const char* otherFileName = other.FileName_ ? other.FileName_ : ""; - int fileNameResult = strcmp(fileName, otherFileName); - if (fileNameResult != 0) { +#include "source_location.h" + +#include <string.h> + +namespace NYT { + +//////////////////////////////////////////////////////////////////////////////// + +const char* TSourceLocation::GetFileName() const +{ + return FileName_; +} + +int TSourceLocation::GetLine() const +{ + return Line_; +} + +bool TSourceLocation::IsValid() const +{ + return FileName_ != nullptr; +} + +bool TSourceLocation::operator<(const TSourceLocation& other) const +{ + const char* fileName = FileName_ ? FileName_ : ""; + const char* otherFileName = other.FileName_ ? other.FileName_ : ""; + int fileNameResult = strcmp(fileName, otherFileName); + if (fileNameResult != 0) { return fileNameResult < 0; - } - - if (Line_ < other.Line_) { - return true; - } - if (Line_ > other.Line_) { - return false; - } - - return false; -} - -bool TSourceLocation::operator==(const TSourceLocation& other) const -{ - const char* fileName = FileName_ ? FileName_ : ""; - const char* otherFileName = other.FileName_ ? other.FileName_ : ""; - return - strcmp(fileName, otherFileName) == 0 && - Line_ == other.Line_; -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT + } + + if (Line_ < other.Line_) { + return true; + } + if (Line_ > other.Line_) { + return false; + } + + return false; +} + +bool TSourceLocation::operator==(const TSourceLocation& other) const +{ + const char* fileName = FileName_ ? FileName_ : ""; + const char* otherFileName = other.FileName_ ? other.FileName_ : ""; + return + strcmp(fileName, otherFileName) == 0 && + Line_ == other.Line_; +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT |