From c5f27feb8d739b0c68f38f36f13c945fa299198a Mon Sep 17 00:00:00 2001 From: Csoki Date: Mon, 21 Nov 2022 19:03:18 +0100 Subject: [PATCH] refactor: GetRandomString --- [esx]/es_extended/common/functions.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/[esx]/es_extended/common/functions.lua b/[esx]/es_extended/common/functions.lua index a9362ac7..2282e630 100644 --- a/[esx]/es_extended/common/functions.lua +++ b/[esx]/es_extended/common/functions.lua @@ -7,11 +7,7 @@ for i = 97, 122 do table.insert(Charset, string.char(i)) end function ESX.GetRandomString(length) math.randomseed(GetGameTimer()) - if length > 0 then - return ESX.GetRandomString(length - 1) .. Charset[math.random(1, #Charset)] - else - return '' - end + return length > 0 and ESX.GetRandomString(length - 1) .. Charset[math.random(1, #Charset)] or '' end function ESX.GetConfig()