mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 08:38:17 +00:00
Updated sanitizeCategory to better account for category names.
R=whesse@google.com Review-Url: https://codereview.chromium.org/3011813002 .
This commit is contained in:
parent
a60fb341f5
commit
9f9aafc337
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue