8000 convert unnecessary `.from`s to `.of`s by pq · Pull Request #3577 · dart-archive/linter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

convert unnecessary .froms to .ofs #3577

Merged
merged 1 commit into from
Aug 3, 2022
Merged
10000
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/src/util/boolean_expression_utilities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import 'package:analyzer/dart/ast/token.dart';

class BooleanExpressionUtilities {
static HashSet<TokenType> BOOLEAN_OPERATIONS =
HashSet.from(const [TokenType.AMPERSAND_AMPERSAND, TokenType.BAR_BAR]);
HashSet.of(const [TokenType.AMPERSAND_AMPERSAND, TokenType.BAR_BAR]);

static HashSet<TokenType> EQUALITY_OPERATIONS =
HashSet.from(const [TokenType.EQ_EQ, TokenType.BANG_EQ]);
HashSet.of(const [TokenType.EQ_EQ, TokenType.BANG_EQ]);

static HashMap<TokenType, TokenType> IMPLICATIONS = HashMap.from(const {
static HashMap<TokenType, TokenType> IMPLICATIONS = HashMap.of(const {
TokenType.GT: TokenType.GT_EQ,
TokenType.LT: TokenType.LT_EQ,
});

static HashMap<TokenType, TokenType> NEGATIONS = HashMap.from(const {
static HashMap<TokenType, TokenType> NEGATIONS = HashMap.of(const {
TokenType.EQ_EQ: TokenType.BANG_EQ,
TokenType.BANG_EQ: TokenType.EQ_EQ,
TokenType.GT: TokenType.LT_EQ,
Expand All @@ -32,7 +32,7 @@ class BooleanExpressionUtilities {
});

static HashSet<TokenType> TRICHOTOMY_OPERATORS =
HashSet.from(const [TokenType.EQ_EQ, TokenType.LT, TokenType.GT]);
HashSet.of(const [TokenType.EQ_EQ, TokenType.LT, TokenType.GT]);

static final HashSet<TokenType> COMPARISONS = HashSet.from(NEGATIONS.keys);
static final HashSet<TokenType> COMPARISONS = HashSet.of(NEGATIONS.keys);
}
4 changes: 2 additions & 2 deletions lib/src/util/tested_expressions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TestedExpressions {
}

_contradictions = _findContradictoryComparisons(
LinkedHashSet.from(facts),
LinkedHashSet.of(facts),
binaryExpression != null
? binaryExpression.operator.type
: TokenType.AMPERSAND_AMPERSAND);
Expand Down Expand Up @@ -200,7 +200,7 @@ class TestedExpressions {
}

var set = _findContradictoryComparisons(
HashSet.from([ex.leftOperand, ex.rightOperand]), ex.operator.type);
HashSet.of([ex.leftOperand, ex.rightOperand]), ex.operator.type);
expressions.addAll(set);
};
}
0