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

Side by Side Diff: pkg/analyzer/lib/src/task/incremental_element_builder.dart

Issue 1918923003: Remove unnecessary casts and general code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.task.incremental_element_builder; 5 library analyzer.src.task.incremental_element_builder;
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/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 break; 296 break;
297 } 297 }
298 oldToken = oldToken.next; 298 oldToken = oldToken.next;
299 newToken = newToken.next; 299 newToken = newToken.next;
300 } 300 }
301 } 301 }
302 302
303 static Token getBeginTokenNotComment(AstNode node) { 303 static Token getBeginTokenNotComment(AstNode node) {
304 Token oldBeginToken = node.beginToken; 304 Token oldBeginToken = node.beginToken;
305 if (oldBeginToken is CommentToken) { 305 if (oldBeginToken is CommentToken) {
306 oldBeginToken = (oldBeginToken as CommentToken).parent; 306 return oldBeginToken.parent;
307 } 307 }
308 return oldBeginToken; 308 return oldBeginToken;
309 } 309 }
310 310
311 /** 311 /**
312 * Return the token string of all the [node] tokens. 312 * Return the token string of all the [node] tokens.
313 */ 313 */
314 static String getFullCode(AstNode node) { 314 static String getFullCode(AstNode node) {
315 List<Token> tokens = getTokens(node); 315 List<Token> tokens = getTokens(node);
316 return joinTokens(tokens); 316 return joinTokens(tokens);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 int oldOffset = element.nameOffset; 364 int oldOffset = element.nameOffset;
365 int newOffset = map[oldOffset]; 365 int newOffset = map[oldOffset];
366 assert(newOffset != null); 366 assert(newOffset != null);
367 (element as ElementImpl).nameOffset = newOffset; 367 (element as ElementImpl).nameOffset = newOffset;
368 if (element is! LibraryElement) { 368 if (element is! LibraryElement) {
369 super.visitElement(element); 369 super.visitElement(element);
370 } 370 }
371 } 371 }
372 } 372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698