diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-23 18:27:51 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-23 18:27:51 +0000 |
commit | 1e708fed188e3471cc7bed13635ba69b48bc8cf7 (patch) | |
tree | a8322082bbcf08272ae039843de237f0bf427134 /py/qstr.c | |
parent | b051e7d167ac00576e45a6a1de291b8ff6bcd6a3 (diff) | |
download | micropython-1e708fed188e3471cc7bed13635ba69b48bc8cf7.tar.gz micropython-1e708fed188e3471cc7bed13635ba69b48bc8cf7.zip |
py: Implement bool unary op; tidy up unary op dispatch.
Diffstat (limited to 'py/qstr.c')
-rw-r--r-- | py/qstr.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -106,7 +106,7 @@ qstr qstr_find_strn(const byte *str, uint str_len) { // search pools for the data for (qstr_pool_t *pool = last_pool; pool != NULL; pool = pool->prev) { for (const byte **q = pool->qstrs, **q_top = pool->qstrs + pool->len; q < q_top; q++) { - if (Q_GET_HASH(*q) == str_hash && Q_GET_LENGTH(*q) == str_len && strncmp((const char*)Q_GET_DATA(*q), (const char*)str, str_len) == 0) { + if (Q_GET_HASH(*q) == str_hash && Q_GET_LENGTH(*q) == str_len && memcmp(Q_GET_DATA(*q), str, str_len) == 0) { return pool->total_prev_len + (q - pool->qstrs); } } |