[feature-systemd] Defer order of error checking for efficiency
This commit is contained in:
parent
08e08a0f90
commit
7900cc95e1
@ -223,11 +223,6 @@ namespace service {
|
||||
config["down4"].c_str()
|
||||
);
|
||||
while (getline(cin, sentence)) {
|
||||
// exit on core dump
|
||||
if (sentence.find("Segmentation fault") != string::npos)
|
||||
exit(EXIT_FAILURE);
|
||||
if (sentence.find("Error") != string::npos)
|
||||
exit(EXIT_FAILURE);
|
||||
auto data = sentence.data();
|
||||
cmatch matches;
|
||||
if (regex_match(data, matches, gesture_begin)) {
|
||||
@ -251,6 +246,10 @@ namespace service {
|
||||
swipe.udx = matches[6];
|
||||
swipe.udy = matches[7];
|
||||
swipe.on_update();
|
||||
} else if (sentence.find("Segmentation fault") != string::npos) {
|
||||
exit(EXIT_FAILURE);
|
||||
} else if (sentence.find("Error") != string::npos) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user