Skip to content

Commit 655eccf

Browse files
authored
Restore the use of unidecode for in/ni operators (#212)
* Restore the use of unidecode for in/ni operators * Update changelog and version
1 parent 021bb96 commit 655eccf

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.50.0
2+
3+
* FSL-style "in" expressions use unidecode again
4+
15
# 2.49.0
26

37
* FSL-style "in" expressions now allow numeric comparisons, but they no longer use unidecode to remove diacritics.

evaluator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,16 +387,15 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
387387
if (f->value.array.array[2]->type == JSON_ARRAY &&
388388
(strcmp(f->value.array.array[1]->value.string.string, "in") == 0 ||
389389
strcmp(f->value.array.array[1]->value.string.string, "ni") == 0)) {
390-
static std::vector<std::string> no_unidecode_data;
391-
std::string s = mvt_value_to_string(lhs, fail, no_unidecode_data);
390+
std::string s = mvt_value_to_string(lhs, fail, unidecode_data);
392391
if (fail) {
393392
return -1; // null in anything => false
394393
}
395394

396395
bool contains = false;
397396
for (size_t i = 0; i < f->value.array.array[2]->value.array.length; i++) {
398397
fail = false;
399-
int cmp = compare_fsl(ff, f->value.array.array[2]->value.array.array[i], fail, no_unidecode_data);
398+
int cmp = compare_fsl(ff, f->value.array.array[2]->value.array.array[i], fail, unidecode_data);
400399
if (fail) {
401400
continue; // null
402401
}

version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef VERSION_HPP
22
#define VERSION_HPP
33

4-
#define VERSION "v2.49.0"
4+
#define VERSION "v2.50.0"
55

66
#endif

0 commit comments

Comments
 (0)