diff options
| author | OpportunityLiu <[email protected]> | 2019-06-19 13:11:01 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-19 13:11:01 +0800 |
| commit | 0ea0f53bf8b4f52c05337e5966545baf28d8a582 (patch) | |
| tree | d980e6ef1d4a2a5cb1c67daa7d77e422bf4b8455 /xmake/core/base/table.lua | |
| parent | 8dedbdc46bf2b5414d3d65a2056546b5f6cecd79 (diff) | |
revert is_array
Diffstat (limited to 'xmake/core/base/table.lua')
| -rw-r--r-- | xmake/core/base/table.lua | 15 |
1 files 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 |
