summaryrefslogtreecommitdiff
path: root/py/qstr.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-02-19 23:44:01 +1100
committerDamien George <damien.p.george@gmail.com>2019-02-19 23:44:01 +1100
commit2b575418b6c0b97966d77fc1b093c5ed34d92670 (patch)
tree640b98c95188ca264f80bcccbe38d509ce5b2f94 /py/qstr.c
parenta270cf280b22a969581a7f1ca1ad6ba071bad299 (diff)
py/qstr: Evaluate find_qstr only once then pass to Q_GET_HASH macro.
Q_GET_HASH may evaluate its argument more than once.
Diffstat (limited to 'py/qstr.c')
-rw-r--r--py/qstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/qstr.c b/py/qstr.c
index a06b84f15..e6f86401a 100644
--- a/py/qstr.c
+++ b/py/qstr.c
@@ -251,7 +251,8 @@ qstr qstr_from_strn(const char *str, size_t len) {
}
mp_uint_t qstr_hash(qstr q) {
- return Q_GET_HASH(find_qstr(q));
+ const byte *qd = find_qstr(q);
+ return Q_GET_HASH(qd);
}
size_t qstr_len(qstr q) {