From 06ea2d9e9e0b7b5404a36371f9a8e49f274de48f Mon Sep 17 00:00:00 2001 From: Sjshovan Date: Tue, 31 Dec 2019 16:18:29 -0500 Subject: [PATCH] remove unnecessary string conversions --- battlestations.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/battlestations.lua b/battlestations.lua index 3cda176..5c2922a 100644 --- a/battlestations.lua +++ b/battlestations.lua @@ -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) @@ -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 @@ -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 @@ -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 @@ -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