Skip to content

Commit

Permalink
Fix parsing for autokick by rating.
Browse files Browse the repository at this point in the history
Matches of the form "2000-3000" were being interpreted first in its
entirety as a bounded range and then again as "2000-".  Now the match
checks are in an if-else chain instead, so the first match ends the
parsing.
  • Loading branch information
aiannacc committed Apr 22, 2014
1 parent 84fc634 commit 8590dcb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/ext/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,12 @@

if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\+/)) !== null) {
range.min = GS.parseNum(m[2]);
}
if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)-(\d+(.\d+)?([kK])?)/)) !== null) {
} else if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)-(\d+(.\d+)?([kK])?)/)) !== null) {
range.min = GS.parseNum(m[2]);
range.max = GS.parseNum(m[5]);
}
if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\-/)) !== null) {
} else if ((m = tablename.match(/^(.* |)(\d+(.\d+)?([kK])?)\-/)) !== null) {
range.max = GS.parseNum(m[2]);
}
if ((m = tablename.match(/^(.* |)\+\/\-(\d+(.\d+)?([kK])?)/)) !== null) {
} else if ((m = tablename.match(/^(.* |)\+\/\-(\d+(.\d+)?([kK])?)/)) !== null) {
range.difference = GS.parseNum(m[2]);
}
return range;
Expand Down

0 comments on commit 8590dcb

Please sign in to comment.