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

Unified Diff: runtime/lib/typed_data_patch.dart

Issue 2750163004: Add type parameters to methods in typed-data patch. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typed_data_patch.dart
diff --git a/runtime/lib/typed_data_patch.dart b/runtime/lib/typed_data_patch.dart
index 4a0dd3e3af81334e85477ab84442e497efcc4c09..c3df4d4711a1b6e8ce36ab05b45faadec13f78f3 100644
--- a/runtime/lib/typed_data_patch.dart
+++ b/runtime/lib/typed_data_patch.dart
@@ -59,8 +59,7 @@ abstract class _TypedListBase {
return value;
}
- dynamic fold(
- dynamic initialValue, dynamic combine(dynamic initialValue, element)) {
+ T fold<T>(T initialValue, T combine(T initialValue, element)) {
var len = this.length;
for (var i = 0; i < len; ++i) {
initialValue = combine(initialValue, this[i]);
@@ -68,9 +67,10 @@ abstract class _TypedListBase {
return initialValue;
}
- Iterable map(f(element)) => new MappedIterable(this, f);
+ Iterable<T> map<T>(T f(element)) => new MappedIterable<dynamic, T>(this, f);
- Iterable expand(Iterable f(element)) => new ExpandIterable(this, f);
+ Iterable<T> expand<T>(Iterable<T> f(element)) =>
+ new ExpandIterable<dynamic, T>(this, f);
bool every(bool f(element)) {
var len = this.length;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698