Fixup some array helpers

Some StringData* helpers were forwarding to CStrRef
methods - which now forward to StringData* methods. Just
call the StringData* methods directly

Other methods were using stack allocated StringData's.
Thats pointlessly risky for slow-path code. Use a String
instead.
Esse commit está contido em:
mwilliams
2013-02-10 16:40:33 -08:00
commit de Sara Golemon
commit ac0ec5696a
2 arquivos alterados com 11 adições e 12 exclusões
+2 -3
Ver Arquivo
@@ -530,8 +530,7 @@ TypedValue* ArrayData::nvGet(int64 k) const {
}
TypedValue* ArrayData::nvGet(const StringData* key) const {
StrNR k(key);
return exists(k) ? (TypedValue*)&get(k, false) :
return exists(key) ? (TypedValue*)&get(key, false) :
NULL;
}
@@ -555,7 +554,7 @@ TypedValue* ArrayData::nvGetCell(int64 k) const {
}
TypedValue* ArrayData::nvGetCell(const StringData* key) const {
TypedValue* tv = (TypedValue*)&get(StrNR(key), false);
TypedValue* tv = (TypedValue*)&get(key, false);
return LIKELY(tv != (TypedValue*)&null_variant) ? tvToCell(tv) :
nvGetNotFound(key);
}