Skip to content

Commit

Permalink
Merge pull request #10 from aab29/feature/use-isempty
Browse files Browse the repository at this point in the history
[FINAL] Using `isEmpty` and `isNotEmpty` instead of comparing to `length`
  • Loading branch information
aab29 authored Feb 20, 2019
2 parents 952dc8e + 6e1f83c commit bf9471b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog - bezier

## v 1.1.1 - February 20 2019

- Changed usages of `length == 0` and `length > 0` to `isEmpty` and `isNotEmpty`,
respectively, in accordance with hints provided by Pub

## v 1.1.0 - January 30 2019

- Added `nearestTValue` method to `Bezier` class, based on work by @luigi-rosso -- Thanks!
Expand Down
4 changes: 2 additions & 2 deletions lib/src/bezier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,13 @@ abstract class Bezier {
var firstIntersection = intersectionsToFilter[0];
var sublist = intersectionsToFilter.sublist(1);
final filteredList = <Intersection>[firstIntersection];
while (sublist.length > 0) {
while (sublist.isNotEmpty) {
sublist.removeWhere((intersection) {
return intersection.isWithinTValueOf(
firstIntersection, minTValueDifference);
});

if (sublist.length > 0) {
if (sublist.isNotEmpty) {
firstIntersection = sublist[0];
sublist = sublist.sublist(1);
filteredList.add(firstIntersection);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bezier_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ List<Intersection> locateIntersectionsRecursively(
indicesOfOverlappingSegmentPairs(pairLeftSides, pairRightSides);

final results = <Intersection>[];
if (overlappingPairIndices.length == 0) {
if (overlappingPairIndices.isEmpty) {
return results;
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: bezier
version: 1.1.0
version: 1.1.1
authors:
- Aaron Barrett <[email protected]>
- Isaac Barrett <[email protected]>
Expand Down

0 comments on commit bf9471b

Please sign in to comment.