Skip to content

Commit

Permalink
remove unnecessary string conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
LoTekkie committed Dec 31, 2019
1 parent bd44a37 commit 06ea2d9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions battlestations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,17 @@ windower.register_event('addon command', function(command, ...)
end

local command_args = {...}

local respond = false
local response_message = ''
local success = true

if command == 'list' or command == 'l' then
local list_type = tostring(command_args[1] or '*'):lower()
local list_type = (command_args[1] or '*'):lower()
local category = command_args[2]

if help.aliases.list.stations:contains(list_type) then
if category then
category = tostring(category)
if categoryValid(category) then
displayStations(category)

Expand Down Expand Up @@ -433,9 +432,9 @@ windower.register_event('addon command', function(command, ...)
elseif command == 'set' or command == 's' then
respond = true

local frequency = tostring(command_args[1]):lower()
local frequency = command_args[1]:lower()

local radio = tostring(command_args[2] or '*'):lower()
local radio = (command_args[2] or '*'):lower()

if not frequencyValid(frequency) then
success = false
Expand Down Expand Up @@ -468,7 +467,7 @@ windower.register_event('addon command', function(command, ...)
respond = true

local current_stations = resolveCurrentStations()
local radio = tostring(command_args[1] or '*'):lower()
local radio = (command_args[1] or '*'):lower()
local frequency = current_stations[radio]
local frequency2 = current_stations.party
local individual = false
Expand Down Expand Up @@ -520,7 +519,7 @@ windower.register_event('addon command', function(command, ...)
elseif command == 'default' or command == 'd' then
respond = true

local radio = tostring(command_args[1] or '*'):lower()
local radio = (command_args[1] or '*'):lower()

if not radioValid(radio) then
success = false
Expand Down Expand Up @@ -549,7 +548,7 @@ windower.register_event('addon command', function(command, ...)
elseif command == 'normal' or command == 'n' then
respond = true

local radio = tostring(command_args[1] or '*'):lower()
local radio = (command_args[1] or '*'):lower()

if not radioValid(radio) then
success = false
Expand Down

0 comments on commit 06ea2d9

Please sign in to comment.