title: Most efficient way to determine if a Lua table is empty (contains no entries)?
body: <p>What's the most efficient way to determine if a table is empty (that is, currently contains neither array-style values nor dict-style values)?</p>
  
  <p>Currently, I'm using <code>next()</code>:</p>
  
  <pre><code>if not next(myTable) then
      -- Table is empty
  end
  </code></pre>
  
  <p>Is there a more efficient way?</p>
  
  <p>Note: The <code>#</code> operator does not suffice here, as it only operates on the array-style values in the table - thus <code>#{test=2}</code> is indistinguishable from <code>#{}</code> because both return 0. Also note that checking if the table variable is <code>nil</code> does not suffice as I am not looking for nil values, but rather tables with 0 entries (i.e. <code>{}</code>).</p>