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

Unified Diff: sdk/lib/math/rectangle.dart

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Update status files. Created 3 years, 12 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 | « sdk/lib/math/math.dart ('k') | tests/benchmark_smoke/benchmark_smoke.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/math/rectangle.dart
diff --git a/sdk/lib/math/rectangle.dart b/sdk/lib/math/rectangle.dart
index 6fe20755c258697a2ecda9e43b4a709bd73c83ae..2145cc739fb0758cae06befd326ece8d72fe23fe 100644
--- a/sdk/lib/math/rectangle.dart
+++ b/sdk/lib/math/rectangle.dart
@@ -209,8 +209,8 @@ class MutableRectangle<T extends num> extends _RectangleBase<T>
* point `(left, top)`.
*/
MutableRectangle(this.left, this.top, T width, T height)
- : this._width = (width < 0) ? _clampToZero/*<T>*/(width) : width,
- this._height = (height < 0) ? _clampToZero/*<T>*/(height) : height;
+ : this._width = (width < 0) ? _clampToZero<T>(width) : width,
+ this._height = (height < 0) ? _clampToZero<T>(height) : height;
/**
* Create a mutable rectangle spanned by the points [a] and [b];
@@ -244,7 +244,7 @@ class MutableRectangle<T extends num> extends _RectangleBase<T>
* but will not change [left].
*/
void set width(T width) {
- if (width < 0) width = _clampToZero/*<T>*/(width);
+ if (width < 0) width = _clampToZero<T>(width);
_width = width;
}
@@ -260,7 +260,7 @@ class MutableRectangle<T extends num> extends _RectangleBase<T>
* but will not change [top].
*/
void set height(T height) {
- if (height < 0) height = _clampToZero/*<T>*/(height);
+ if (height < 0) height = _clampToZero<T>(height);
_height = height;
}
}
@@ -270,7 +270,7 @@ class MutableRectangle<T extends num> extends _RectangleBase<T>
*
* Returns `0` if value is int, `0.0` if value is double.
*/
-num/*=T*/ _clampToZero/*<T extends num>*/(num/*=T*/ value) {
+T _clampToZero<T extends num>(T value) {
assert(value < 0);
return -value * 0;
}
« no previous file with comments | « sdk/lib/math/math.dart ('k') | tests/benchmark_smoke/benchmark_smoke.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698