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

Unified Diff: pkg/front_end/lib/src/fasta/parser/parser.dart

Issue 2801963003: Use identical to compare strings. (Closed)
Patch Set: Created 3 years, 8 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: pkg/front_end/lib/src/fasta/parser/parser.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index f323b4519c356cb29e55355deacd0e461ec1286a..ac126bbdb6783df3768461801d72fc1af366e95d 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -1025,9 +1025,9 @@ class Parser {
/// [value2], or [value3].
bool isOneOf3(Token token, String value1, String value2, String value3) {
String stringValue = token.stringValue;
- return value1 == stringValue ||
- value2 == stringValue ||
- value3 == stringValue;
+ return identical(value1, stringValue) ||
+ identical(value2, stringValue) ||
+ identical(value3, stringValue);
}
/// Returns true if the stringValue of the [token] is either [value1],
@@ -1035,10 +1035,10 @@ class Parser {
bool isOneOf4(
Token token, String value1, String value2, String value3, String value4) {
String stringValue = token.stringValue;
- return value1 == stringValue ||
- value2 == stringValue ||
- value3 == stringValue ||
- value4 == stringValue;
+ return identical(value1, stringValue) ||
+ identical(value2, stringValue) ||
+ identical(value3, stringValue) ||
+ identical(value4, stringValue);
}
bool notEofOrValue(String value, Token token) {
« 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