Skip to content

Commit 16b5922

Browse files
anmyachevvnlitvinov
authored andcommitted
cast first char symbol to unsigned char for functions for kh_str_starts_t khash struct
1 parent 1e25c6b commit 16b5922

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/src/klib/khash_python.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ inline static kh_str_starts_t* kh_init_str_starts(void) {
9999
inline static khint_t kh_put_str_starts_item(kh_str_starts_t* table, char* key, int* ret) {
100100
khint_t result = kh_put_str(table->table, key, ret);
101101
if (*ret != 0) {
102-
table->starts[key[0]] = 1;
102+
table->starts[(unsigned char)key[0]] = 1;
103103
}
104104
return result;
105105
}
106106

107107
inline static khint_t kh_get_str_starts_item(kh_str_starts_t* table, char* key) {
108-
int ch = *key;
108+
unsigned char ch = *key;
109109
if (table->starts[ch]) {
110110
if (ch == '\0' || kh_get_str(table->table, key) != table->table->n_buckets) return 1;
111111
}

0 commit comments

Comments
 (0)