X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/2f1f0c572a85f3d393315b6b63aff12a063649b3..430e70670c3f0a38c1c300273784096aeb8728cd:/helpers.lua?ds=inline diff --git a/helpers.lua b/helpers.lua index 50254c1..8eed10f 100644 --- a/helpers.lua +++ b/helpers.lua @@ -144,6 +144,16 @@ end -- {{{ Misc +-- check if an element exist on a table +function helpers.element_in_table(element, tbl) + for _, i in pairs(tbl) do + if i == element then + return true + end + end + return false +end + -- iterate over table of records sorted by keys function helpers.spairs(t) -- collect the keys