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

Unified Diff: pkg/barback/lib/src/asset_set.dart

Issue 21226004: Refactor the barback tests somewhat. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: AssetSet additions Created 7 years, 5 months 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 | « no previous file | pkg/barback/lib/src/cancelable_future.dart » ('j') | pkg/barback/test/asset_set_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/asset_set.dart
diff --git a/pkg/barback/lib/src/asset_set.dart b/pkg/barback/lib/src/asset_set.dart
index f58e188cb2be5e5ff2f75b2a28dbf72e40e622c6..91f5c98fe7d54da8a1d2abb34b3c09b6572aa837 100644
--- a/pkg/barback/lib/src/asset_set.dart
+++ b/pkg/barback/lib/src/asset_set.dart
@@ -18,6 +18,14 @@ import 'asset_id.dart';
class AssetSet extends IterableBase<Asset> {
final _assets = new Map<AssetId, Asset>();
+ AssetSet();
+
+ AssetSet.from(Iterable<Asset> other) {
Bob Nystrom 2013/07/30 22:25:02 Document, especially that later Assets take preced
nweiz 2013/07/30 22:46:21 Done.
+ for (var asset in other) {
+ _assets[asset.id] = asset;
+ }
+ }
+
Iterator<Asset> get iterator => _assets.values.iterator;
int get length => _assets.length;
@@ -51,6 +59,8 @@ class AssetSet extends IterableBase<Asset> {
return _assets.containsKey(id);
}
+ Asset removeId(AssetId id) => _assets.remove(id);
Bob Nystrom 2013/07/30 22:25:02 Document.
nweiz 2013/07/30 22:46:21 Done.
+
/// Removes all assets from the set.
void clear() {
_assets.clear();
« no previous file with comments | « no previous file | pkg/barback/lib/src/cancelable_future.dart » ('j') | pkg/barback/test/asset_set_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698