Skip to content

Commit 40a9f74

Browse files
committed
Applying clang-tidy suggested fixes.
1 parent 9c945a7 commit 40a9f74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_class_sh_trampoline_shared_from_this.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ struct SftSharedPtrStash {
4444
std::vector<std::shared_ptr<Sft>> stash;
4545
explicit SftSharedPtrStash(int ser_no) : ser_no{ser_no} {}
4646
void Add(const std::shared_ptr<Sft> &obj) {
47-
if (obj->history.size()) {
47+
if (!obj->history.empty()) {
4848
obj->history += "_Stash" + std::to_string(ser_no) + "Add";
4949
}
5050
stash.push_back(obj);
5151
}
5252
void AddSharedFromThis(Sft *obj) {
5353
auto sft = obj->shared_from_this();
54-
if (sft->history.size()) {
54+
if (!sft->history.empty()) {
5555
sft->history += "_Stash" + std::to_string(ser_no) + "AddSharedFromThis";
5656
}
5757
stash.push_back(sft);
@@ -74,7 +74,7 @@ struct SftTrampoline : Sft, py::trampoline_self_life_support {
7474

7575
long pass_shared_ptr(const std::shared_ptr<Sft> &obj) {
7676
auto sft = obj->shared_from_this();
77-
if (sft->history.size()) {
77+
if (!sft->history.empty()) {
7878
sft->history += "_PassSharedPtr";
7979
}
8080
return sft.use_count();

0 commit comments

Comments
 (0)