From b34cd3ad04f8e98bf787f186d258b9a071e5aafb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 5 Feb 2013 16:15:38 +0100 Subject: [PATCH] Remove some duplicated code Change-Id: I02857ad6ab74bb70aebe1b6b74c21171e8d87d03 Reviewed-by: Erik Verbruggen --- src/v4/qmljs_runtime.cpp | 2 +- src/v4/qv4object.h | 25 ++----------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/v4/qmljs_runtime.cpp b/src/v4/qmljs_runtime.cpp index d01d76d..e192b40 100644 --- a/src/v4/qmljs_runtime.cpp +++ b/src/v4/qmljs_runtime.cpp @@ -616,7 +616,7 @@ void __qmljs_set_element(ExecutionContext *ctx, Value object, Value index, Value uint idx = index.asArrayIndex(); if (idx < UINT_MAX) { - PropertyDescriptor *p = o->nonSparseArrayAtRef(idx); + PropertyDescriptor *p = o->nonSparseArrayAt(idx); if (p && p->type == PropertyDescriptor::Data && p->isWritable()) { p->value = value; return; diff --git a/src/v4/qv4object.h b/src/v4/qv4object.h index 948948b..c9a4337 100644 --- a/src/v4/qv4object.h +++ b/src/v4/qv4object.h @@ -283,7 +283,7 @@ public: return true; } - PropertyDescriptor *arrayAt(uint index) { + PropertyDescriptor *arrayAt(uint index) const { if (!sparseArray) { if (index >= arrayDataLen) return 0; @@ -296,7 +296,7 @@ public: } } - const PropertyDescriptor *nonSparseArrayAt(uint index) const { + PropertyDescriptor *nonSparseArrayAt(uint index) const { if (sparseArray) return 0; if (index >= arrayDataLen) @@ -304,27 +304,6 @@ public: return arrayData + index; } - PropertyDescriptor *nonSparseArrayAtRef(uint index) { - if (sparseArray) - return 0; - if (index >= arrayDataLen) - return 0; - return arrayData + index; - } - - const PropertyDescriptor *arrayAt(uint index) const { - if (!sparseArray) { - if (index >= arrayDataLen) - return 0; - return arrayData + index; - } else { - SparseArrayNode *n = sparseArray->findNode(index); - if (!n) - return 0; - return arrayData + n->value; - } - } - void markArrayObjects() const; PropertyDescriptor *front() { -- 2.7.4