Software /
code /
prosody
Comparison
util/sql.lua @ 7513:8a6c7c4b15fb
util.sql: remove unused one-letter loop variables [luacheck]
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 23 Jul 2016 18:22:05 +0800 |
parent | 7431:0d991d5659f0 |
child | 8073:7361412a9664 |
comparison
equal
deleted
inserted
replaced
7512:7a655ff689b1 | 7513:8a6c7c4b15fb |
---|---|
47 return setmetatable(definition, index_mt); | 47 return setmetatable(definition, index_mt); |
48 end | 48 end |
49 | 49 |
50 function table_mt:__tostring() | 50 function table_mt:__tostring() |
51 local s = { 'name="'..self.__table__.name..'"' } | 51 local s = { 'name="'..self.__table__.name..'"' } |
52 for i,col in ipairs(self.__table__) do | 52 for _, col in ipairs(self.__table__) do |
53 s[#s+1] = tostring(col); | 53 s[#s+1] = tostring(col); |
54 end | 54 end |
55 return 'Table{ '..t_concat(s, ", ")..' }' | 55 return 'Table{ '..t_concat(s, ", ")..' }' |
56 end | 56 end |
57 table_mt.__index = {}; | 57 table_mt.__index = {}; |
292 if self._debug then | 292 if self._debug then |
293 debugquery("create", sql); | 293 debugquery("create", sql); |
294 end | 294 end |
295 local success,err = self:execute(sql); | 295 local success,err = self:execute(sql); |
296 if not success then return success,err; end | 296 if not success then return success,err; end |
297 for i,v in ipairs(table.__table__) do | 297 for _, v in ipairs(table.__table__) do |
298 if is_index(v) then | 298 if is_index(v) then |
299 self:_create_index(v); | 299 self:_create_index(v); |
300 end | 300 end |
301 end | 301 end |
302 return success; | 302 return success; |