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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1691943002: Don't use Set when collecting constant targets in a unit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/constant_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.constant; 5 library analyzer.src.generated.constant;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 * those compilation units. 1241 * those compilation units.
1242 */ 1242 */
1243 class ConstantFinder extends RecursiveAstVisitor<Object> { 1243 class ConstantFinder extends RecursiveAstVisitor<Object> {
1244 final AnalysisContext context; 1244 final AnalysisContext context;
1245 final Source source; 1245 final Source source;
1246 final Source librarySource; 1246 final Source librarySource;
1247 1247
1248 /** 1248 /**
1249 * The elements and AST nodes whose constant values need to be computed. 1249 * The elements and AST nodes whose constant values need to be computed.
1250 */ 1250 */
1251 HashSet<ConstantEvaluationTarget> constantsToCompute = 1251 List<ConstantEvaluationTarget> constantsToCompute =
1252 new HashSet<ConstantEvaluationTarget>(); 1252 <ConstantEvaluationTarget>[];
1253 1253
1254 /** 1254 /**
1255 * True if instance variables marked as "final" should be treated as "const". 1255 * True if instance variables marked as "final" should be treated as "const".
1256 */ 1256 */
1257 bool treatFinalInstanceVarAsConst = false; 1257 bool treatFinalInstanceVarAsConst = false;
1258 1258
1259 ConstantFinder(this.context, this.source, this.librarySource); 1259 ConstantFinder(this.context, this.source, this.librarySource);
1260 1260
1261 @override 1261 @override
1262 Object visitAnnotation(Annotation node) { 1262 Object visitAnnotation(Annotation node) {
(...skipping 4149 matching lines...) Expand 10 before | Expand all | Expand 10 after
5412 return BoolState.from(_element == rightElement); 5412 return BoolState.from(_element == rightElement);
5413 } else if (rightOperand is DynamicState) { 5413 } else if (rightOperand is DynamicState) {
5414 return BoolState.UNKNOWN_VALUE; 5414 return BoolState.UNKNOWN_VALUE;
5415 } 5415 }
5416 return BoolState.FALSE_STATE; 5416 return BoolState.FALSE_STATE;
5417 } 5417 }
5418 5418
5419 @override 5419 @override
5420 String toString() => _element == null ? "-unknown-" : _element.name; 5420 String toString() => _element == null ? "-unknown-" : _element.name;
5421 } 5421 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/constant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698