From: Peter van Dijk Date: Tue, 2 Apr 2019 12:11:52 +0000 (+0200) Subject: simplify vector indexing X-Git-Tag: dnsdist-1.4.0-alpha1~29^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d51414dca9805a2c2fab5dba4ca3972831b5a4e;p=pdns simplify vector indexing --- diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index c359d6a15..22848be73 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -659,10 +659,10 @@ void setupLuaBindings(bool client) g_lua.registerFunction("count", [](const EDNSOptionView& option) { return option.values.size(); }); - g_lua.registerFunction>(EDNSOptionView::*)()>("getValues", [] (const EDNSOptionView& option) { - std::vector > values; + g_lua.registerFunction(EDNSOptionView::*)()>("getValues", [] (const EDNSOptionView& option) { + std::vector values; for (const auto& value : option.values) { - values.push_back(std::make_pair(values.size()+1, std::string(value.content, value.size))); + values.push_back(std::string(value.content, value.size)); } return values; });