title: Is it better to set a table to empty or set all elements of a table to nil?
body: <p>A question about a piece of lua code came up during a code review I had recently. The code in question is flushing a cache and reinitializing it with some data:</p>
  
  <pre><code>for filename,_ in pairs(fileTable) do
      fileTable[filename] = nil
  end
  
  -- reinitialize here
  </code></pre>
  
  <p>Is there any reason the above loop shouldn't be replaced with this?</p>
  
  <pre><code>fileTable = { }
  
  -- reinitialize here
  </code></pre>