diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-04-12 15:03:16 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-04-12 15:28:39 +0200 |
commit | 9b6e522a52e92d992f3e363164ca94392e8461e7 (patch) | |
tree | 3039f54093884950aae7697578e6b6c3347523f4 /src/v4/qv4object.cpp | |
parent | e49724a4435a2a5ae5f33901a26201222465dde9 (diff) |
Remove getValueChecked()
In the two places where we need to check, we can do it
more easily on the calling side.
Change-Id: I259d3cc798660121bba13208ef46e371e3173053
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/v4/qv4object.cpp')
-rw-r--r-- | src/v4/qv4object.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/v4/qv4object.cpp b/src/v4/qv4object.cpp index b68c8de8be..04eb74b41c 100644 --- a/src/v4/qv4object.cpp +++ b/src/v4/qv4object.cpp @@ -881,9 +881,8 @@ Value Object::arrayIndexOf(Value v, uint fromIndex, uint endIndex, ExecutionCont } } else if (sparseArray) { for (SparseArrayNode *n = sparseArray->lowerBound(fromIndex); n != sparseArray->end() && n->key() < endIndex; n = n->nextNode()) { - bool exists; - Value value = o->getValueChecked(ctx, arrayData + n->value, arrayAttributes ? arrayAttributes[n->value] : Attr_Data, &exists); - if (exists && __qmljs_strict_equal(value, v, ctx)) + Value value = o->getValue(ctx, arrayData + n->value, arrayAttributes ? arrayAttributes[n->value] : Attr_Data); + if (__qmljs_strict_equal(value, v, ctx)) return Value::fromDouble(n->key()); } } else { @@ -893,10 +892,11 @@ Value Object::arrayIndexOf(Value v, uint fromIndex, uint endIndex, ExecutionCont Property *end = pd + endIndex; pd += fromIndex; while (pd < end) { - bool exists; - Value value = o->getValueChecked(ctx, pd, arrayAttributes ? arrayAttributes[pd - arrayData] : Attr_Data, &exists); - if (exists && __qmljs_strict_equal(value, v, ctx)) - return Value::fromDouble(pd - arrayData); + if (!arrayAttributes || !arrayAttributes[pd - arrayData].isGeneric()) { + Value value = o->getValue(ctx, pd, arrayAttributes ? arrayAttributes[pd - arrayData] : Attr_Data); + if (__qmljs_strict_equal(value, v, ctx)) + return Value::fromDouble(pd - arrayData); + } ++pd; } } |