From 030af3e7af210617df00bf850476df6b46fb004d Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 30 Sep 2024 16:16:20 +0200 Subject: Enable readability-* checks. --- src/buildtool/file_system/file_root.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/buildtool/file_system/file_root.hpp') diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp index 82e30b89..fed32177 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -667,9 +667,11 @@ class FileRoot { return std::pair(FileRoot{path}, std::move(path)); } if (root[0] == FileRoot::kGitTreeMarker) { - if (not(root.size() == 3 and root[1].is_string() and - root[2].is_string()) and - not(root.size() == 2 and root[1].is_string())) { + bool const has_one_arg = root.size() == 2 and root[1].is_string(); + bool const has_two_args = root.size() == 3 and + root[1].is_string() and + root[2].is_string(); + if (not has_one_arg and not has_two_args) { *error_msg = fmt::format( "\"git tree\" scheme expects one or two string " "arguments, but found {} for {} of repository {}", @@ -709,9 +711,11 @@ class FileRoot { std::move(path)); } if (root[0] == FileRoot::kGitTreeIgnoreSpecialMarker) { - if (not(root.size() == 3 and root[1].is_string() and - root[2].is_string()) and - not(root.size() == 2 and root[1].is_string())) { + bool const has_one_arg = root.size() == 2 and root[1].is_string(); + bool const has_two_args = root.size() == 3 and + root[1].is_string() and + root[2].is_string(); + if (not has_one_arg and not has_two_args) { *error_msg = fmt::format( "\"git tree ignore-special\" scheme expects one or two " "string arguments, but found {} for {} of repository {}", -- cgit v1.2.3