Commit Graph

4 Commits

Author SHA1 Message Date
Uli Schlachter 4744a744f0 gears.table.join: Ignore nil arguments (#2440)
When calling join with e.g. arguments (nil, {"a"}), then everything past
the nil was ignored, because the code internally used ipairs() to
iterate over the arguments and this stops at the first nil it
encounters.

Fix this by using select() to iterate over the arguments.

This also adds a unit test for this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-16 10:17:45 -04:00
Emmanuel Lepage Vallee da68b3cbaf table.join: Make deterministic.
`pairs` order isn't defined and `{...}` will always be ordered.
There is no reason to have random behavior where it can be
predicted at no additional cost.
2018-10-01 14:57:55 -04:00
romildo d22207386f Add map function to gears.table 2017-03-20 20:20:36 -04:00
Kevin Zander c3461b535c gears: Move awful.util.table to gears.table (#1641)
* Move table functions out of awful.util into new gears.table

* travis: Use v9999 prefix for full requests

Make sure no newly deprecated functions are used

* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
2017-03-08 15:18:33 -05:00