summaryrefslogtreecommitdiff
path: root/py/qstr.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-08-11 16:34:02 +1000
committerDamien George <damien@micropython.org>2022-08-11 23:18:02 +1000
commit82b3500724206f2baa342a3559bbe716e9819426 (patch)
tree45e04bb190754e77871ff645acce5c2b28a47420 /py/qstr.h
parent94a19f10628f9c3a9978daae9f6f4c7ac352e9a2 (diff)
py/qstr: Change qstr hash type from mp_uint_t to size_t.
The hash is either 8 or 16 bits (depending on MICROPY_QSTR_BYTES_IN_HASH) so will fit in a size_t. This saves 268 bytes on the unix nanbox build. Non-nanbox configurations are unchanged because mp_uint_t is the same size as size_t. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/qstr.h')
-rw-r--r--py/qstr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/qstr.h b/py/qstr.h
index a463b67a1..0ef861f33 100644
--- a/py/qstr.h
+++ b/py/qstr.h
@@ -78,7 +78,7 @@ typedef struct _qstr_pool_t {
void qstr_init(void);
-mp_uint_t qstr_compute_hash(const byte *data, size_t len);
+size_t qstr_compute_hash(const byte *data, size_t len);
qstr qstr_find_strn(const char *str, size_t str_len); // returns MP_QSTRnull if not found
qstr qstr_from_str(const char *str);