title: ruby array intersection performance issue
body: <p>I need to make intersection of n-arrays with millions of elements (database ID's).
  This code works perfect, but slow (with very big arrays). How can i improve it? </p>
  
  <pre><code>[[1,2,3,4],[2,4,6,8],[4,5,8]].inject([]){|c,v| c = v if c.size==0; c = c&amp;v if c.size&gt;0; c }
  </code></pre>