diff options
author | tldr <[email protected]> | 2022-02-10 16:50:18 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:18 +0300 |
commit | fb217752f4b5a81abe9df05e38c5a71d080fc2a8 (patch) | |
tree | b61080bac892e4d99c55a947c93ddee756202193 /util/folder/path.cpp | |
parent | c3356aebb686e7128a19f75ef61d57388131f12f (diff) |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/folder/path.cpp')
-rw-r--r-- | util/folder/path.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/util/folder/path.cpp b/util/folder/path.cpp index bfe0c67d687..400fa907417 100644 --- a/util/folder/path.cpp +++ b/util/folder/path.cpp @@ -40,25 +40,25 @@ bool TFsPath::IsSubpathOf(const TFsPath& that) const { return std::equal(rsplit.begin(), rsplit.end(), split.begin()); } -bool TFsPath::IsNonStrictSubpathOf(const TFsPath& that) const { - const TSplit& split = GetSplit(); - const TSplit& rsplit = that.GetSplit(); - - if (rsplit.IsAbsolute != split.IsAbsolute) { - return false; - } - - if (rsplit.Drive != split.Drive) { - return false; - } - - if (rsplit.size() > split.size()) { - return false; - } - - return std::equal(rsplit.begin(), rsplit.end(), split.begin()); -} - +bool TFsPath::IsNonStrictSubpathOf(const TFsPath& that) const { + const TSplit& split = GetSplit(); + const TSplit& rsplit = that.GetSplit(); + + if (rsplit.IsAbsolute != split.IsAbsolute) { + return false; + } + + if (rsplit.Drive != split.Drive) { + return false; + } + + if (rsplit.size() > split.size()) { + return false; + } + + return std::equal(rsplit.begin(), rsplit.end(), split.begin()); +} + TFsPath TFsPath::RelativeTo(const TFsPath& root) const { TSplit split = GetSplit(); const TSplit& rsplit = root.GetSplit(); |