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:
@@ -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);
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário