aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-08-01 15:21:23 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-08-02 14:00:40 +0000
commit36df81a9893fb5343eb0bfc2e5dbd5e2a8ea3224 (patch)
treed1f41f659e6bf14d4675cc937281cc0303a6f04e /src/qml/jsruntime/qv4value_p.h
parent3a36c19befa0d30d41ee19de33c95e8f7af20557 (diff)
Tune asArrayIndex
Change-Id: Icc8a05b9a04d98e6e7c29f1d5b2cea32ce75ad24 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 0e7fc844fa..7629e764cf 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -559,8 +559,8 @@ inline uint Value::asArrayIndex() const
inline bool Value::asArrayIndex(uint &idx) const
{
- if (!isDouble()) {
- if (isInteger() && int_32() >= 0) {
+ if (Q_LIKELY(!isDouble())) {
+ if (Q_LIKELY(isInteger() && int_32() >= 0)) {
idx = (uint)int_32();
return true;
}