-
Notifications
You must be signed in to change notification settings - Fork 87
Changes from 1 commit
b78de08
8f961ff
88aa113
b6ce4b5
72a6789
4ef876d
0bbee8d
c722cdc
6ac3b5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
extension MapExtensions<K, V> on Map<K, V> { | ||
/// Like [Map.entries], but returns each entry as a record. | ||
Iterable<(K, V)> get pairs => entries.map((e) => (e.key, e.value)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting...but why? What's the upside here? What do users get? We're already going to allocate (however short-lived) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main benefit is being able to loop over pairs with variables named something other than "key" and "value". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we're still hoping to make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I doubt it will be over |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version was never published, so we can probably just drop the changelog entry.