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

Unified Diff: lib/src/line_splitting/solve_state.dart

Issue 1492683002: Change the way hard splits are handled. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years 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 | « lib/src/line_splitting/rule_set.dart ('k') | lib/src/line_writer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/line_splitting/solve_state.dart
diff --git a/lib/src/line_splitting/solve_state.dart b/lib/src/line_splitting/solve_state.dart
index 4b58b50106fa275a92e5ca41211f9651f651df86..47489b6e4ae80278da97a853016a7b21f532d4e4 100644
--- a/lib/src/line_splitting/solve_state.dart
+++ b/lib/src/line_splitting/solve_state.dart
@@ -113,11 +113,7 @@ class SolveState {
/// Gets the value to use for [rule], either the bound value or
/// [Rule.unsplit] if it isn't bound.
- int getValue(Rule rule) {
- if (rule is HardSplitRule) return Rule.unsplit;
-
- return _ruleValues.getValue(rule);
- }
+ int getValue(Rule rule) => _ruleValues.getValue(rule);
/// Returns `true` if this state is a better solution to use as the final
/// result than [other].
@@ -437,7 +433,6 @@ class SolveState {
/// live rules were added.
bool _addLiveRules(Rule rule) {
if (rule == null) return false;
- if (rule is HardSplitRule) return false;
var added = false;
for (var constrained in rule.allConstrainedRules) {
@@ -472,7 +467,7 @@ class SolveState {
}
var rule = _splitter.chunks[i].rule;
- if (rule != null && rule is! HardSplitRule) {
+ if (rule != null) {
if (_ruleValues.contains(rule)) {
boundInLine.add(rule);
} else {
« no previous file with comments | « lib/src/line_splitting/rule_set.dart ('k') | lib/src/line_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698