From e2bbec54b3b26173284754b786310fc7d8589ecc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 17 Jul 2024 10:52:37 -0400 Subject: Use empty() method instead of checking length --- src/gui/.clang-tidy | 1 - src/gui/BreadCrumbs.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/.clang-tidy b/src/gui/.clang-tidy index a7b2914c..4dc4facc 100644 --- a/src/gui/.clang-tidy +++ b/src/gui/.clang-tidy @@ -26,6 +26,5 @@ Checks: > -hicpp-multiway-paths-covered, -hicpp-vararg, -llvm-header-guard, - -readability-container-size-empty, -readability-convert-member-functions-to-static, InheritParentConfig: true diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp index 076a259f..eb2d511b 100644 --- a/src/gui/BreadCrumbs.cpp +++ b/src/gui/BreadCrumbs.cpp @@ -92,7 +92,7 @@ BreadCrumbs::build(const raul::Path& path, // Moving to a child of the full path, append crumbs (preserve cache) string suffix = path.substr(_full_path.length()); - while (suffix.length() > 0) { + while (!suffix.empty()) { if (suffix[0] == '/') { suffix = suffix.substr(1); } @@ -135,7 +135,7 @@ BreadCrumbs::build(const raul::Path& path, raul::Path working_path("/"); string suffix = path.substr(1); - while (suffix.length() > 0) { + while (!suffix.empty()) { if (suffix[0] == '/') { suffix = suffix.substr(1); } -- cgit v1.2.1