Skip to content

Commit

Permalink
clang-tidy: fixes errors in Lua filter (envoyproxy#37543)
Browse files Browse the repository at this point in the history
part of envoyproxy#28566

Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake authored Dec 9, 2024
1 parent 33c9494 commit 0ff8fc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/extensions/filters/common/lua/lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ template <class T> class BaseLuaObject : public LuaLoggable {
};

std::vector<luaL_Reg> 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});
Expand Down Expand Up @@ -331,7 +333,7 @@ template <typename T> class LuaRef {

LuaRef(const LuaRef&) = delete;

LuaRef(LuaRef&& that) {
LuaRef(LuaRef&& that) noexcept {
object_ = that.object_;
ref_ = that.ref_;
that.object_ = std::pair<T*, lua_State*>{};
Expand Down Expand Up @@ -394,7 +396,7 @@ template <typename T> class LuaDeathRef : public LuaRef<T> {
using LuaRef<T>::LuaRef;

LuaDeathRef(const LuaDeathRef&) = delete;
LuaDeathRef(LuaDeathRef&&) = default;
LuaDeathRef(LuaDeathRef&&) noexcept = default;

~LuaDeathRef() { markDead(); }

Expand Down

0 comments on commit 0ff8fc3

Please sign in to comment.