Skip to content

Commit

Permalink
refactor(scale_pattern): ♻️ use proper Set argument for exclude
Browse files Browse the repository at this point in the history
Signed-off-by: Albert Mañosa <26429103+albertms10@users.noreply.github.com>
  • Loading branch information
albertms10 committed Jan 19, 2025
1 parent cdc3c9d commit d558df6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/src/scale/scale_pattern.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,9 @@ final class ScalePattern {
///
/// Example:
/// ```dart
/// ScalePattern.major.exclude(const [Interval.m2])
/// == ScalePattern.majorPentatonic
/// ScalePattern.major.exclude({Interval.m2}) == ScalePattern.majorPentatonic
/// ```
ScalePattern exclude(List<Interval> intervals) {
ScalePattern exclude(Set<Interval> intervals) {
final steps = <Interval>[];
for (var i = 0; i < _intervalSteps.length; i++) {
final interval = _intervalSteps[i];
Expand Down
2 changes: 1 addition & 1 deletion test/src/scale/scale_pattern_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ void main() {
group('.exclude()', () {
test('returns a new ScalePattern excluding intervals', () {
expect(
ScalePattern.major.exclude(const [Interval.m2]),
ScalePattern.major.exclude({Interval.m2}),
ScalePattern.majorPentatonic,
);
});
Expand Down

0 comments on commit d558df6

Please sign in to comment.