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

Side by Side Diff: lib/src/line_splitting/rule_set.dart

Issue 1257903002: Optimize splitting long, complex lines. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years, 5 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 | « lib/src/line_splitting/line_splitter.dart ('k') | lib/src/line_splitting/solve_state.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) 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 dart_style.src.rule_set; 5 library dart_style.src.line_splitting.rule_set;
6 6
7 import 'rule/rule.dart'; 7 import '../rule/rule.dart';
8 8
9 /// An optimized data structure for storing a set of values for some rules. 9 /// An optimized data structure for storing a set of values for some rules.
10 /// 10 ///
11 /// This conceptually behaves roughly like a `Map<Rule, int>`, but is much 11 /// This conceptually behaves roughly like a `Map<Rule, int>`, but is much
12 /// faster since it avoids hashing. Instead, it assumes the line splitter has 12 /// faster since it avoids hashing. Instead, it assumes the line splitter has
13 /// provided an ordered list of [Rule]s and that each rule's [index] field has 13 /// provided an ordered list of [Rule]s and that each rule's [index] field has
14 /// been set to point to the rule in the list. 14 /// been set to point to the rule in the list.
15 /// 15 ///
16 /// Internally, this then just stores the values in a sparse list whose indices 16 /// Internally, this then just stores the values in a sparse list whose indices
17 /// are the indices of the rules. 17 /// are the indices of the rules.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 var result = []; 148 var result = [];
149 for (var i = 0; i < _columns.length; i++) { 149 for (var i = 0; i < _columns.length; i++) {
150 if (_columns[i] != null) { 150 if (_columns[i] != null) {
151 result.add("$i:${_columns[i]}"); 151 result.add("$i:${_columns[i]}");
152 } 152 }
153 } 153 }
154 154
155 return result.join(" "); 155 return result.join(" ");
156 } 156 }
157 } 157 }
OLDNEW
« no previous file with comments | « lib/src/line_splitting/line_splitter.dart ('k') | lib/src/line_splitting/solve_state.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698