Code clean up

This changes were proposed by @PiotrNawrot in these PRs: #2967, #2970.
This commit is contained in:
ngosang 2015-06-14 10:12:35 +02:00
parent f5b0008158
commit 4a76526417
2 changed files with 12 additions and 19 deletions

View file

@ -688,18 +688,14 @@ void WebApplication::parsePath()
// check action for requested path
QStringList pathItems = request().path.split('/', QString::SkipEmptyParts);
if (!pathItems.empty()) {
if (actions_.contains(pathItems.front())) {
scope_ = pathItems.front();
pathItems.pop_front();
}
if (!pathItems.empty() && actions_.contains(pathItems.front())) {
scope_ = pathItems.front();
pathItems.pop_front();
}
if (!pathItems.empty()) {
if (actions_[scope_].contains(pathItems.front())) {
action_ = pathItems.front();
pathItems.pop_front();
}
if (!pathItems.empty() && actions_[scope_].contains(pathItems.front())) {
action_ = pathItems.front();
pathItems.pop_front();
}
args_ = pathItems;