diff options
| author | ruki <[email protected]> | 2018-11-12 22:38:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-11-12 09:52:19 +0800 |
| commit | 377840c51da27c07f9d94caf458f99eb197798e3 (patch) | |
| tree | 3561bdbbc9b7a82b06cc68494e3a9f0f52bd5f2d /xmake/core/base/table.lua | |
| parent | f372a5c5cf20e9a7deaa99cdb9d2c14b5aec7755 (diff) | |
improve platform
Diffstat (limited to 'xmake/core/base/table.lua')
| -rw-r--r-- | xmake/core/base/table.lua | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua index 6ee3544a1..de024ff2b 100644 --- a/xmake/core/base/table.lua +++ b/xmake/core/base/table.lua @@ -264,18 +264,13 @@ end -- unwrap object if be only one function table.unwrap(object) - - -- check - assert(object) - - -- unwrap it - if type(object) == "table" and table.getn(object) == 1 then - for _, v in pairs(object) do - return v + if type(object) == "table" then + if #object == 1 then + return object[1] + elseif #object == 0 then + return end end - - -- ok return object end |
