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

Unified Diff: lib/src/algorithms.dart

Issue 1831103004: Fix strong mode warnings. (Closed) Base URL: git@github.com:dart-lang/collection@master
Patch Set: pubspec/changelog Created 4 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 | « CHANGELOG.md ('k') | lib/src/canonicalized_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/algorithms.dart
diff --git a/lib/src/algorithms.dart b/lib/src/algorithms.dart
index 2b66d7df7014cfe921afa2592d5b447e0dc6ed2a..57456a0352f9375ece91872ebb4640d5ee453897 100644
--- a/lib/src/algorithms.dart
+++ b/lib/src/algorithms.dart
@@ -5,7 +5,8 @@
import "dart:math" as math;
/// Version of [binarySearch] optimized for comparable keys
-int _comparableBinarySearch(List<Comparable> list, Comparable value) {
+int _comparableBinarySearch/*<T extends Comparable<T>>*/(
+ List<Comparable/*<T>*/> list, Comparable/*<T>*/ value) {
int min = 0;
int max = list.length;
while (min < max) {
@@ -31,7 +32,8 @@ int _comparableBinarySearch(List<Comparable> list, Comparable value) {
/// the objects.
///
/// Returns -1 if [value] is not in the list by default.
-int binarySearch(List sortedList, value, { int compare(a, b) }) {
+int binarySearch/*<T extends Comparable<T>>*/(
+ List/*<T>*/ sortedList, /*=T*/ value, { int compare(/*=T*/ a, /*=T*/ b) }) {
if (compare == null) {
return _comparableBinarySearch(sortedList, value);
}
@@ -79,7 +81,8 @@ int _comparableLowerBound(List<Comparable> list, Comparable value) {
///
/// Returns [sortedList.length] if all the items in [sortedList] compare less
/// than [value].
-int lowerBound(List sortedList, value, { int compare(a, b) }) {
+int lowerBound/*<T extends Comparable<T>>*/(
abarth 2016/03/26 07:13:23 This change isn't correct. The arguments to this
+ List/*<T>*/ sortedList, /*=T*/ value, { int compare(/*=T*/ a, /*=T*/ b) }) {
if (compare == null) {
return _comparableLowerBound(sortedList, value);
}
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/canonicalized_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698