| Index: pkg/barback/lib/src/asset_id.dart
|
| diff --git a/pkg/barback/lib/src/asset_id.dart b/pkg/barback/lib/src/asset_id.dart
|
| index d514a76d77d666cdf6ebec4184d2ec22ec2efda7..d9cef3261f856ed81abbbe82455c53a74e45c853 100644
|
| --- a/pkg/barback/lib/src/asset_id.dart
|
| +++ b/pkg/barback/lib/src/asset_id.dart
|
| @@ -13,7 +13,7 @@ import 'package:path/path.dart' as pathos;
|
| final _posix = new pathos.Builder(style: pathos.Style.posix);
|
|
|
| /// Identifies an asset within a package.
|
| -class AssetId {
|
| +class AssetId implements Comparable<AssetId> {
|
| /// The name of the package containing this asset.
|
| final String package;
|
|
|
| @@ -73,6 +73,12 @@ class AssetId {
|
|
|
| int get hashCode => package.hashCode ^ path.hashCode;
|
|
|
| + int compareTo(AssetId other) {
|
| + var packageComp = package.compareTo(other.package);
|
| + if (packageComp != 0) return packageComp;
|
| + return path.compareTo(other.path);
|
| + }
|
| +
|
| /// Returns a new [AssetId] with the same [package] as this one and with the
|
| /// [path] extended to include [extension].
|
| AssetId addExtension(String extension) =>
|
|
|