From b1d9f0d28f809d6003d2a8a5e161835669e07f72 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 22 Jun 2021 12:07:25 -0700 Subject: [PATCH] Applying clang-tidy suggested fixes. --- tests/test_class_sh_trampoline_shared_from_this.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_class_sh_trampoline_shared_from_this.cpp b/tests/test_class_sh_trampoline_shared_from_this.cpp index 439a01d6e..3d607dbf5 100644 --- a/tests/test_class_sh_trampoline_shared_from_this.cpp +++ b/tests/test_class_sh_trampoline_shared_from_this.cpp @@ -44,14 +44,14 @@ struct SftSharedPtrStash { std::vector> stash; explicit SftSharedPtrStash(int ser_no) : ser_no{ser_no} {} void Add(const std::shared_ptr &obj) { - if (obj->history.size()) { + if (!obj->history.empty()) { obj->history += "_Stash" + std::to_string(ser_no) + "Add"; } stash.push_back(obj); } void AddSharedFromThis(Sft *obj) { auto sft = obj->shared_from_this(); - if (sft->history.size()) { + if (!sft->history.empty()) { sft->history += "_Stash" + std::to_string(ser_no) + "AddSharedFromThis"; } stash.push_back(sft); @@ -74,7 +74,7 @@ struct SftTrampoline : Sft, py::trampoline_self_life_support { long pass_shared_ptr(const std::shared_ptr &obj) { auto sft = obj->shared_from_this(); - if (sft->history.size()) { + if (!sft->history.empty()) { sft->history += "_PassSharedPtr"; } return sft.use_count();