mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
[python] upgrade to micropython 1.12
This commit is contained in:
committed by
LeaNumworks
parent
010fb1894f
commit
7df8c2935a
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1913,9 +1913,6 @@ mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_u
|
||||
return 0;
|
||||
} else {
|
||||
// can't write to a string
|
||||
bufinfo->buf = NULL;
|
||||
bufinfo->len = 0;
|
||||
bufinfo->typecode = -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -2042,7 +2039,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 +2064,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