* @param value The value.
* @returns true if the array contains the value, false otherwise.
*/
-bool Array::Contains(const String& value) const
+bool Array::Contains(const Value& value) const
{
ASSERT(!OwnsLock());
ObjectLock olock(this);
Iterator End(void);
size_t GetLength(void) const;
- bool Contains(const String& value) const;
+ bool Contains(const Value& value) const;
void Insert(unsigned int index, const Value& value);
void Remove(unsigned int index);
Value left = m_Operand1->Evaluate(context);
Array::Ptr arr = right;
- ObjectLock olock(arr);
- BOOST_FOREACH(const Value& value, arr) {
- if (value == left) {
- return true;
- }
- }
-
- return false;
+ return arr->Contains(left);
}
Value NotInExpression::DoEvaluate(const Object::Ptr& context, DebugHint *dhint) const
Value left = m_Operand1->Evaluate(context);
Array::Ptr arr = right;
- ObjectLock olock(arr);
- BOOST_FOREACH(const Value& value, arr) {
- if (value == left)
- return false;
- }
-
- return true;
+ return !arr->Contains(left);
}
Value LogicalAndExpression::DoEvaluate(const Object::Ptr& context, DebugHint *dhint) const