diff --git a/source/extensions/filters/common/lua/lua.h b/source/extensions/filters/common/lua/lua.h index 95a20075de06..788700cb5cfa 100644 --- a/source/extensions/filters/common/lua/lua.h +++ b/source/extensions/filters/common/lua/lua.h @@ -171,6 +171,8 @@ template class BaseLuaObject : public LuaLoggable { }; std::vector to_register; + // Reserve slots to avoid reallocation, otherwise clang-tidy will complain about it. + to_register.reserve(log_functions.size() + T::exportedFunctions().size() + 2); for (auto& function : log_functions) { to_register.push_back({function.first, function.second}); @@ -331,7 +333,7 @@ template class LuaRef { LuaRef(const LuaRef&) = delete; - LuaRef(LuaRef&& that) { + LuaRef(LuaRef&& that) noexcept { object_ = that.object_; ref_ = that.ref_; that.object_ = std::pair{}; @@ -394,7 +396,7 @@ template class LuaDeathRef : public LuaRef { using LuaRef::LuaRef; LuaDeathRef(const LuaDeathRef&) = delete; - LuaDeathRef(LuaDeathRef&&) = default; + LuaDeathRef(LuaDeathRef&&) noexcept = default; ~LuaDeathRef() { markDead(); }