Skip to content

Commit

Permalink
Fix boolean conjunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Jan 11, 2024
1 parent 5798508 commit f39c222
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ static int eval(std::map<std::string, mvt_value> const &feature, json_object *f,
exit(EXIT_FILTER);
}

if (f->value.array.array[0]->type != JSON_STRING) {
fprintf(stderr, "Filter operation is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}

// FSL conjunctions
if (f->value.array.length == 3 &&
f->value.array.array[1]->type == JSON_STRING &&
Expand Down Expand Up @@ -292,6 +287,11 @@ static int eval(std::map<std::string, mvt_value> const &feature, json_object *f,
exit(EXIT_IMPOSSIBLE);
}

if (f->value.array.array[0]->type != JSON_STRING) {
fprintf(stderr, "Filter operation is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}

if (strcmp(f->value.array.array[0]->value.string.string, "has") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "!has") == 0) {
if (f->value.array.length != 2) {
Expand Down

0 comments on commit f39c222

Please sign in to comment.