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

Unified Diff: tools/gardening/lib/src/util.dart

Issue 3011813002: Updated sanitizeCategory to better account for category names. (Closed)
Patch Set: Modified sanitizeCategory to accout for different lengths of channel Created 3 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gardening/lib/src/util.dart
diff --git a/tools/gardening/lib/src/util.dart b/tools/gardening/lib/src/util.dart
index 2e48792829e170eda60e0be46ad68182c7c6362a..90d56993ae3e6b657a14762b9ea3073ed2d4db5c 100644
--- a/tools/gardening/lib/src/util.dart
+++ b/tools/gardening/lib/src/util.dart
@@ -108,9 +108,7 @@ void processArgResults(ArgResults argResults) {
/// Strips un-wanted characters from string [category] from CBE json.
String sanitizeCategory(String category) {
- // Category name starts with either two or three numbers and
- // end with |all. Instead of doing any fancy regular-expr,
- // we just test if third char is a number.
- return category.substring(
- category.codeUnitAt(2) <= 64 ? 3 : 2, category.length - 4);
+ var reg = new RegExp(r"^[0-9]+(.*)\|all$");
+ var match = reg.firstMatch(category);
+ return match != null ? match.group(1) : category;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698