Dart: Should I prefer to iterate over Map.entries or Map.values? : <p>Every time I need to iterate over the values of a <code>Map</code> in Dart, I contemplate the cost that this loop will incur, in terms of the complexity and the amount of garbage produced. There are two ways to iterate over the values of a <code>Map</code>: <code>Map.values</code>, and <code>Map.entries</code>. For example:</p>

<pre class="lang-dart prettyprint-override"><code>Map&lt;String, Person&gt; people;

int olderThan(int age) {
  int result = 0;
  for(Person p in people.values)
    if(p.age &gt; age) result++;
  return result;
}

int olderThan2(int age) {
  int result = 0;
  for(MapEntry&lt;String, Person&gt; me in people.entries)
    if(me.value.age &gt; age) result++;
  return result;
}

// Which one is faster: olderThan or olderThan2?

</code></pre>

<p>If <code>Map</code> stores its values internally as <code>MapEntry</code> objects, it's possible that <code>entries</code> would be just as efficient or even more efficient than <code>values</code>. The implementation details of <code>Map</code> are buried deep inside Dart libraries, so I wonder if anybody has this knowledge and can shed the light on this subject. </p>

<p>I understand that <code>Map.entries</code> gives you access to the key, but I am talking about cases where I don't need to use the key of the entry. I also understand that there are different implementations of <code>Map</code>. I am mostly interested in the default implementation, <code>LinkedHashMap</code>, but if it would be nice to know if there's a difference between the different <code>Map</code> implementations in this aspect. </p>
