Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Issue 14402013: Revert "- Do not keep growing when creating Lists from Iterables." (Closed)

Created:
7 years, 8 months ago by floitsch
Modified:
7 years, 8 months ago
CC:
reviews_dartlang.org, Lasse Reichstein Nielsen
Visibility:
Public.

Description

Revert "- Do not keep growing when creating Lists from Iterables." This reverts commit r21531. BUG= http://dartbug.com/10070 Committed: https://code.google.com/p/dart/source/detail?r=21817

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -38 lines) Patch
M runtime/lib/array_patch.dart View 1 chunk +0 lines, -38 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
floitsch
Reverting r21531. The CL broke toList of WhereIterables and generally changed the semantics of Iterable.toList ...
7 years, 8 months ago (2013-04-22 16:49:32 UTC) #1
Vyacheslav Egorov (Google)
rubberstamp lgtm
7 years, 8 months ago (2013-04-22 16:51:16 UTC) #2
floitsch
Committed patchset #1 manually as r21817 (presubmit successful).
7 years, 8 months ago (2013-04-22 16:53:25 UTC) #3
siva
On 2013/04/22 16:53:25, floitsch wrote: > Committed patchset #1 manually as r21817 (presubmit successful). Is ...
7 years, 8 months ago (2013-04-23 06:30:32 UTC) #4
Ivan Posva
On 2013/04/23 06:30:32, siva wrote: > On 2013/04/22 16:53:25, floitsch wrote: > > Committed patchset ...
7 years, 8 months ago (2013-04-23 06:38:50 UTC) #5
floitsch
7 years, 8 months ago (2013-04-23 09:19:49 UTC) #6
Message was sent while issue was closed.
On 2013/04/23 06:30:32, siva wrote:
> On 2013/04/22 16:53:25, floitsch wrote:
> > Committed patchset #1 manually as r21817 (presubmit successful).
> 
> Is toList broken because we end up iterating twice inside toList?

Yes.
We recommend users to use "toList" to become non-lazy.
[1, 2, 3].where((x) => foo(x)).toList()

If foo has a side-effect then toList will execute foo twice on every element.

Powered by Google App Engine
This is Rietveld 408576698