mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py: Rename MP_QSTR_NULL to MP_QSTRnull to avoid intern collisions.
Fixes #5140.
This commit is contained in:
committed by
Damien George
parent
b596638b9b
commit
7d58a197cf
@@ -169,7 +169,7 @@ mp_obj_t mp_obj_str_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
|
||||
|
||||
// Check if a qstr with this data already exists
|
||||
qstr q = qstr_find_strn((const char*)str_data, str_len);
|
||||
if (q != MP_QSTR_NULL) {
|
||||
if (q != MP_QSTRnull) {
|
||||
return MP_OBJ_NEW_QSTR(q);
|
||||
}
|
||||
|
||||
@@ -2042,7 +2042,7 @@ mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr) {
|
||||
// if not a bytes object, look if a qstr with this data already exists
|
||||
if (type == &mp_type_str) {
|
||||
qstr q = qstr_find_strn(vstr->buf, vstr->len);
|
||||
if (q != MP_QSTR_NULL) {
|
||||
if (q != MP_QSTRnull) {
|
||||
vstr_clear(vstr);
|
||||
vstr->alloc = 0;
|
||||
return MP_OBJ_NEW_QSTR(q);
|
||||
@@ -2067,7 +2067,7 @@ mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr) {
|
||||
|
||||
mp_obj_t mp_obj_new_str(const char* data, size_t len) {
|
||||
qstr q = qstr_find_strn(data, len);
|
||||
if (q != MP_QSTR_NULL) {
|
||||
if (q != MP_QSTRnull) {
|
||||
// qstr with this data already exists
|
||||
return MP_OBJ_NEW_QSTR(q);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user