@@ -89,15 +89,15 @@ void memcached_handler (struct memcached_service *p, int fd);
89
89
int memcached_setsockopt (int fd , const char * family , const char * type );
90
90
]]
91
91
92
- function startswith (str , start )
92
+ local function startswith (str , start )
93
93
return string.sub (str , 1 , string.len (start )) == start
94
94
end
95
95
96
96
local typetable = {
97
97
name = {
98
98
' string' ,
99
99
function () return ' memcached' end ,
100
- function (x ) return true end ,
100
+ function (_ ) return true end ,
101
101
[[ Name of memcached instance]]
102
102
},
103
103
uri = {
@@ -115,7 +115,7 @@ local typetable = {
115
115
expire_enabled = {
116
116
' boolean' ,
117
117
function () return true end ,
118
- function (x ) return true end ,
118
+ function () return true end ,
119
119
[[ configure availability of expiration daemon]]
120
120
},
121
121
expire_items_per_iter = {
@@ -217,6 +217,9 @@ local function config_initial(cfg)
217
217
box .error { reason = err }
218
218
end
219
219
220
+ -- TODO: This function is unused, but I see a good idea behind it: show
221
+ -- available options and its default values. Perhaps someday we will use it.
222
+ -- luacheck: no unused
220
223
local function config_help ()
221
224
for k , v in pairs (typetable ) do
222
225
log .info (' %s: %s' , k , v [4 ])
@@ -310,14 +313,14 @@ local memcached_methods = {
310
313
if (self .listener ~= nil ) then
311
314
self .listener :close ()
312
315
end
313
- local rc = memcached_internal .memcached_stop (self .service )
316
+ memcached_internal .memcached_stop (self .service )
314
317
self .status = STOPPED
315
318
return self
316
319
end ,
317
320
info = function (self )
318
321
local stats = memcached_internal .memcached_get_stat (self .service )
319
322
local retval = {}
320
- for k , v in pairs (stat_table ) do
323
+ for _ , v in pairs (stat_table ) do
321
324
retval [v ] = stats [0 ][v ]
322
325
end
323
326
return retval
0 commit comments