Restore the use of unidecode for in/ni operators (#212)

* Restore the use of unidecode for in/ni operators

* Update changelog and version
This commit is contained in:
Erica Fischer
2024-03-08 09:22:55 -08:00
committed by GitHub
parent 021bb96aeb
commit 655eccfcc3
3 changed files with 7 additions and 4 deletions
+4
View File
@@ -1,3 +1,7 @@
# 2.50.0
* FSL-style "in" expressions use unidecode again
# 2.49.0 # 2.49.0
* FSL-style "in" expressions now allow numeric comparisons, but they no longer use unidecode to remove diacritics. * FSL-style "in" expressions now allow numeric comparisons, but they no longer use unidecode to remove diacritics.
+2 -3
View File
@@ -387,8 +387,7 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
if (f->value.array.array[2]->type == JSON_ARRAY && if (f->value.array.array[2]->type == JSON_ARRAY &&
(strcmp(f->value.array.array[1]->value.string.string, "in") == 0 || (strcmp(f->value.array.array[1]->value.string.string, "in") == 0 ||
strcmp(f->value.array.array[1]->value.string.string, "ni") == 0)) { strcmp(f->value.array.array[1]->value.string.string, "ni") == 0)) {
static std::vector<std::string> no_unidecode_data; std::string s = mvt_value_to_string(lhs, fail, unidecode_data);
std::string s = mvt_value_to_string(lhs, fail, no_unidecode_data);
if (fail) { if (fail) {
return -1; // null in anything => false return -1; // null in anything => false
} }
@@ -396,7 +395,7 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
bool contains = false; bool contains = false;
for (size_t i = 0; i < f->value.array.array[2]->value.array.length; i++) { for (size_t i = 0; i < f->value.array.array[2]->value.array.length; i++) {
fail = false; fail = false;
int cmp = compare_fsl(ff, f->value.array.array[2]->value.array.array[i], fail, no_unidecode_data); int cmp = compare_fsl(ff, f->value.array.array[2]->value.array.array[i], fail, unidecode_data);
if (fail) { if (fail) {
continue; // null continue; // null
} }
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP #ifndef VERSION_HPP
#define VERSION_HPP #define VERSION_HPP
#define VERSION "v2.49.0" #define VERSION "v2.50.0"
#endif #endif