Module:Video game reviews/sandbox: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
reduce variable scopes
Jackmcbarn (talk | contribs)
better variable name, and remove unnecessary table
Line 530:
 
function p._reviewbox(reviewBoxArgs)
local t = {}
local flags = {}
local nitem = {}
Line 541 ⟶ 540:
custome_agg, custome_rev = #activeAggregators, #activeReviewers
 
local sortedArgKeys = {}
for k in pairs(args) do
if type(k) == 'string' then
table.insert(tsortedArgKeys, k)
end
end
table.sort(tsortedArgKeys)
local keys = t
 
-- creates a table of all unique reviewers.
for i=1,#keyssortedArgKeys do
if string.find(tostring(keyssortedArgKeys[i]), '_') ~= nil and platforms >= 1 then
halfargs = Split(tostring(keyssortedArgKeys[i]),'_')
for k=1, #reviewer do
if reviewer[k][2] == halfargs[1] then
Line 562 ⟶ 561:
end
end
elseif string.find(tostring(keyssortedArgKeys[i]), '_') == nil and platforms == 0 then
for k=1, #reviewer do
if reviewer[k][2] == keyssortedArgKeys[i] then
nitem[j] = keyssortedArgKeys[i]
j = j + 1
end
Line 578 ⟶ 577:
local j = 1
-- creates a table of all unique aggregators.
for i=1,#keyssortedArgKeys do
if string.find(tostring(keyssortedArgKeys[i]), '_') ~= nil and platforms >= 1 then
halfargs = Split(tostring(keyssortedArgKeys[i]),'_')
for k=1, #aggregator do
if aggregator[k][2] == halfargs[1] then
Line 590 ⟶ 589:
end
end
elseif string.find(tostring(keyssortedArgKeys[i]), '_') == nil and platforms == 0 then
for k=1, #aggregator do
if aggregator[k][2] == keyssortedArgKeys[i] then
nitem[j] = keyssortedArgKeys[i]
j = j + 1
end