From 0ea0f53bf8b4f52c05337e5966545baf28d8a582 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Wed, 19 Jun 2019 13:11:01 +0800 Subject: revert is_array --- xmake/core/base/table.lua | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua index fab299da1..e21680379 100644 --- a/xmake/core/base/table.lua +++ b/xmake/core/base/table.lua @@ -178,23 +178,12 @@ end -- is array? function table.is_array(array) - if type(array) == "table" then - local i = 0 - for _ in pairs(array) do - i = i + 1 - if array[i] == nil then - return false - end - end - return true - else - return false - end + return type(array) == "table" and array[1] ~= nil end -- is dictionary? function table.is_dictionary(dict) - return type(dict) == "table" and not table.is_array(dict) + return type(dict) == "table" and dict[1] == nil end -- unwrap object if be only one -- cgit v1.3.1