From 2f0f98c98a0606cd110692e7dbed6793c7675ea5 Mon Sep 17 00:00:00 2001 From: andriish Date: Fri, 12 Apr 2024 21:25:37 +0200 Subject: [PATCH] update context.cpp use `empty()` to avoid clang-tidy warnings (#294) --- source/context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/context.cpp b/source/context.cpp index f7cdb061..57a5168e 100644 --- a/source/context.cpp +++ b/source/context.cpp @@ -116,7 +116,7 @@ PYBIND11_MODULE({2}, root_module) {{ std::vector< std::pair > sub_modules {{ {3} }}; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_");