prefer_contains (#8040)

This commit is contained in:
Alexandre Ardhuin 2017-02-10 00:17:55 +01:00 committed by Adam Barth
parent 60f5cbbad2
commit e151a1a438
2 changed files with 3 additions and 3 deletions

View File

@ -125,9 +125,9 @@ Future<String> getDartVersion() async {
// Dart VM version: 1.17.0-dev.2.0 (Tue May 3 12:14:52 2016) on "macos_x64"
// to:
// 1.17.0-dev.2.0
if (version.indexOf('(') != -1)
if (version.contains('('))
version = version.substring(0, version.indexOf('(')).trim();
if (version.indexOf(':') != -1)
if (version.contains(':'))
version = version.substring(version.indexOf(':') + 1).trim();
return version.replaceAll('"', "'");

View File

@ -127,7 +127,7 @@ class Daemon {
try {
String method = request['method'];
if (method.indexOf('.') == -1)
if (!method.contains('.'))
throw 'method not understood: $method';
String prefix = method.substring(0, method.indexOf('.'));