PIM: fix cppcheck control flow warning

The "func" variable was correctly initialized to NULL if no comparsion
matches, but cppcheck 1.65 warns anyway. Use the more readable
intialization to NULL in the final else clause.
This commit is contained in:
Patrick Ohly 2014-06-25 11:52:57 +00:00
parent 535bb97ae8
commit fdd66536ce
1 changed files with 3 additions and 1 deletions

View File

@ -1093,7 +1093,7 @@ public:
// Pick default operation. Will be replaced with
// telephone-specific operation once we know that the
// field is 'phones/value'.
bool (AnyContainsBoost::*func)(const char *text) const = NULL;
bool (AnyContainsBoost::*func)(const char *text) const;
if (operation == "contains") {
func = &AnyContainsBoost::containsSearchText;
} else if (operation == "is") {
@ -1102,6 +1102,8 @@ public:
func = &AnyContainsBoost::beginsWithSearchText;
} else if (operation == "ends-with") {
func = &AnyContainsBoost::endsWithSearchText;
} else {
func = NULL;
}
if (func) {
switch (terms.size()) {