aboutsummaryrefslogtreecommitdiffstats
path: root/src/ruleparser.cpp
diff options
context:
space:
mode:
authorTorgny Nyblom <kde@nyblom.org>2010-03-14 10:23:10 +0100
committerTorgny Nyblom <kde@nyblom.org>2010-03-14 10:23:10 +0100
commit714aaf1aa594e5d7821596e5e499a4039361f920 (patch)
tree371ce871c929f5c50ff2a637c646a7c64f28d99c /src/ruleparser.cpp
parentdf8fe0ebc356a8a3d919bb4ff9f2a0bd859d6f58 (diff)
downloadsvn2git-714aaf1aa594e5d7821596e5e499a4039361f920.tar
svn2git-714aaf1aa594e5d7821596e5e499a4039361f920.tar.gz
svn2git-714aaf1aa594e5d7821596e5e499a4039361f920.tar.bz2
svn2git-714aaf1aa594e5d7821596e5e499a4039361f920.tar.xz
svn2git-714aaf1aa594e5d7821596e5e499a4039361f920.zip
Remove duplicate regexp
Diffstat (limited to 'src/ruleparser.cpp')
-rw-r--r--src/ruleparser.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp
index f80b866..ac3bf64 100644
--- a/src/ruleparser.cpp
+++ b/src/ruleparser.cpp
@@ -47,9 +47,6 @@ void Rules::load()
return;
// initialize the regexps we will use
- QRegExp repoLine("create repository\\s+(\\S+)", Qt::CaseInsensitive);
- QRegExp repoBranchLine("branch\\s+(\\S+)", Qt::CaseInsensitive);
-
QRegExp matchLine("match\\s+(.*)", Qt::CaseInsensitive);
QRegExp matchActionLine("action\\s+(\\w+)", Qt::CaseInsensitive);
QRegExp matchRepoLine("repository\\s+(\\S+)", Qt::CaseInsensitive);
@@ -75,9 +72,9 @@ void Rules::load()
continue;
if (state == ReadingRepository) {
- if (repoBranchLine.exactMatch(line)) {
+ if (matchBranchLine.exactMatch(line)) {
Repository::Branch branch;
- branch.name = repoBranchLine.cap(1);
+ branch.name = matchBranchLine.cap(1);
repo.branches += branch;
continue;
@@ -122,14 +119,14 @@ void Rules::load()
}
}
- bool isRepositoryRule = repoLine.exactMatch(line);
+ bool isRepositoryRule = matchRepoLine.exactMatch(line);
bool isMatchRule = matchLine.exactMatch(line);
if (isRepositoryRule) {
// repository rule
state = ReadingRepository;
repo = Repository(); // clear
- repo.name = repoLine.cap(1);
+ repo.name = matchRepoLine.cap(1);
repo.lineNumber = lineNumber;
} else if (isMatchRule) {
// match rule