Use * instead of {0,}

This commit is contained in:
Nicolas Stepien 2011-10-09 03:25:55 +02:00
parent 57c94a394c
commit e64ea74bbe
2 changed files with 4 additions and 4 deletions

View File

@ -530,13 +530,13 @@
init: function() {
var f, filter, key, m, _i, _len;
for (key in config.filter) {
if (!(m = conf[key].match(/^\/.+\/\w{0,}$/gm))) {
if (!(m = conf[key].match(/^\/.+\/\w*$/gm))) {
continue;
}
this.regexps[key] = [];
for (_i = 0, _len = m.length; _i < _len; _i++) {
filter = m[_i];
f = filter.match(/^\/(.+)\/(\w{0,})$/);
f = filter.match(/^\/(.+)\/(\w*)$/);
this.regexps[key].push(RegExp(f[1], f[2]));
}
if (this.regexps[key].length) {

View File

@ -386,11 +386,11 @@ filter =
callbacks: []
init: ->
for key of config.filter
unless m = conf[key].match /^\/.+\/\w{0,}$/gm
unless m = conf[key].match /^\/.+\/\w*$/gm
continue
@regexps[key] = []
for filter in m
f = filter.match /^\/(.+)\/(\w{0,})$/
f = filter.match /^\/(.+)\/(\w*)$/
@regexps[key].push RegExp f[1], f[2]
#only execute what's filterable
@callbacks.push @[key] if @regexps[key].length