Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 4025742

Browse files
committed
use Py_MIN
1 parent 01c37d2 commit 4025742

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

automap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ lookup_hash_unicode(
913913
}
914914
p_start = (Py_UCS4*)PyArray_GETPTR1(a, table[table_pos].keys_pos);
915915
// memcmp returns 0 on match
916-
if (!memcmp(p_start, key, (key_size < dt_size ? key_size : dt_size))) {
916+
if (!memcmp(p_start, key, Py_MIN(key_size, dt_size))) {
917917
return table_pos;
918918
}
919919
table_pos++;
@@ -954,7 +954,7 @@ lookup_hash_string(
954954
}
955955
p_start = (char*)PyArray_GETPTR1(a, table[table_pos].keys_pos);
956956
// memcmp returns 0 on match
957-
if (!memcmp(p_start, key, (key_size < dt_size ? key_size : dt_size))) {
957+
if (!memcmp(p_start, key, Py_MIN(key_size, dt_size))) {
958958
return table_pos;
959959
}
960960
table_pos++;

0 commit comments

Comments
 (0)