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

Unified Diff: pkg/analyzer/lib/src/task/html.dart

Issue 1411253007: Extract 'computeLineStarts' utility. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move into StringUtilities. Created 5 years, 2 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 | « pkg/analyzer/lib/src/generated/java_engine.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/html.dart
diff --git a/pkg/analyzer/lib/src/task/html.dart b/pkg/analyzer/lib/src/task/html.dart
index b603f1f7139c2dc6c96f6cc5abfa232b86155334..219e1ee6e482320acd08651cfe9ba65d77e74ead 100644
--- a/pkg/analyzer/lib/src/task/html.dart
+++ b/pkg/analyzer/lib/src/task/html.dart
@@ -360,12 +360,7 @@ class ParseHtmlTask extends SourceBasedAnalysisTask {
* Compute [LineInfo] for the given [content].
*/
static LineInfo _computeLineInfo(String content) {
- List<int> lineStarts = <int>[0];
- for (int index = 0; index < content.length; index++) {
- if (content.codeUnitAt(index) == 0x0A) {
- lineStarts.add(index + 1);
- }
- }
+ List<int> lineStarts = StringUtilities.computeLineStarts(content);
return new LineInfo(lineStarts);
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/java_engine.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698