py/qstr: Evaluate find_qstr only once then pass to Q_GET_HASH macro.

Q_GET_HASH may evaluate its argument more than once.
pull/4530/head
Damien George 2019-02-19 23:44:01 +11:00
rodzic a270cf280b
commit 2b575418b6
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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) {