Lint fixes for type_array.h

Just tackling one file at a time.
Esse commit está contido em:
Edwin Smith
2013-04-23 08:33:01 -07:00
commit de Sara Golemon
commit f0394e1d0d
4 arquivos alterados com 6 adições e 43 exclusões
-9
Ver Arquivo
@@ -83,15 +83,6 @@ Array &Array::operator = (Variant&& v) {
return *this;
}
HOT_FUNC
Array &Array::operator=(const StaticArray &arr) {
if (m_px != arr.m_px) {
if (m_px) decRefArr(m_px);
m_px = arr.m_px;
}
return *this;
}
Array Array::operator+(ArrayData *data) const {
return Array(m_px).operator+=(data);
}
+5 -27
Ver Arquivo
@@ -14,14 +14,14 @@
+----------------------------------------------------------------------+
*/
#ifndef incl_HPHP_ARRAY_H_
#define incl_HPHP_ARRAY_H_
#ifndef incl_HPHP_INSIDE_HPHP_COMPLEX_TYPES_H_
#error Directly including 'type_array.h' is prohibited. \
Include 'complex_types.h' instead.
#endif
#ifndef incl_HPHP_ARRAY_H_
#define incl_HPHP_ARRAY_H_
#include <boost/static_assert.hpp>
#include <runtime/base/util/smart_ptr.h>
@@ -39,7 +39,6 @@ inline int64_t ToKey(double d) {
// forward declaration
class ArrayIter;
class StaticArray;
/**
* Array type wrapping around ArrayData to implement reference
@@ -80,8 +79,8 @@ class Array : protected SmartPtr<ArrayData> {
* array value from the parameter, and they are NOT constructing an array
* with that single value (then one should use Array::Create() functions).
*/
Array(ArrayData *data) : ArrayBase(data) { }
Array(CArrRef arr) : ArrayBase(arr.m_px) { }
/* implicit */ Array(ArrayData *data) : ArrayBase(data) { }
/* implicit */ Array(CArrRef arr) : ArrayBase(arr.m_px) { }
// Move ctor
Array(Array&& src) : ArrayBase(std::move(src)) {
@@ -125,7 +124,6 @@ class Array : protected SmartPtr<ArrayData> {
Array &operator = (ArrayData *data);
Array &operator = (CArrRef v);
Array &operator = (CVarRef v);
Array &operator = (const StaticArray &v);
Array operator + (ArrayData *data) const;
Array operator + (CArrRef v) const;
Array operator + (CVarRef v) const;
@@ -514,26 +512,6 @@ class Array : protected SmartPtr<ArrayData> {
}
};
///////////////////////////////////////////////////////////////////////////////
/**
* A StaticArray can be co-accessed by multiple threads, therefore they are
* not thread local, and they have to be allocated BEFORE any thread starts,
* so that they won't be garbage collected by MemoryManager. This is used by
* scalar arrays, so they can be pre-allocated before request handling.
*/
class StaticArray : public Array {
public:
StaticArray() { }
StaticArray(ArrayData *data) : Array(data) {
}
~StaticArray() {
// prevent ~SmartPtr from calling decRefCount after data is released
m_px = nullptr;
}
};
///////////////////////////////////////////////////////////////////////////////
// ArrNR
-6
Ver Arquivo
@@ -129,12 +129,6 @@ class Variant : private TypedValue {
assert(s);
m_data.pstr = s;
}
Variant(const StaticArray &v) {
m_type = KindOfArray;
ArrayData *a = v.get();
assert(a);
m_data.parr = a;
}
Variant(CStrRef v);
Variant(CArrRef v);
+1 -1
Ver Arquivo
@@ -1029,7 +1029,7 @@ Variant SSATmp::getValVariant() const {
return (litstr)m_inst->getExtra<ConstData>()
->as<const StringData*>()->data();
case KindOfArray:
return StaticArray(ArrayData::GetScalarArray(m_inst->getExtra<ConstData>()
return Array(ArrayData::GetScalarArray(m_inst->getExtra<ConstData>()
->as<ArrayData*>()));
case KindOfObject:
return m_inst->getExtra<ConstData>()->as<const Object*>();