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

Unified Diff: utils/pub/utils.dart

Issue 10867070: Support removing dead packages with `pub install`. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
Index: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index f4e8f401958d5233bca4e675b9632ce96c3187c6..4f64d875e8e772cb9111af1172b00eff04d113c9 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -81,6 +81,16 @@ only(Iterable iter) {
}
/**
+ * Returns a set containing all elements in [minuend] that are not in
+ * [subtrahend].
+ */
+Set setMinus(Collection minuend, Collection subtrahend) {
+ var minuendSet = new Set.from(minuend);
+ minuendSet.removeAll(subtrahend);
+ return minuendSet;
+}
+
+/**
* Replace each instance of [matcher] in [source] with the return value of [fn].
*/
String replace(String source, Pattern matcher, String fn(Match)) {

Powered by Google App Engine
This is Rietveld 408576698