mirror of
https://github.com/ultrajson/ultrajson.git
synced 2024-11-23 12:32:02 +01:00
Revert "Minor performance optimization"
This reverts commit 510a8fc6d7fd2af9fd39970ff3de4d9aac382706.
This commit is contained in:
parent
510a8fc6d7
commit
0d76bd0849
@ -161,11 +161,8 @@ enum JSTYPES
|
||||
typedef void * JSOBJ;
|
||||
typedef void * JSITER;
|
||||
|
||||
#define JSON_TYPECONTEXT_PRIVATE_BUFFER_SIZE 128
|
||||
|
||||
typedef struct __JSONTypeContext
|
||||
{
|
||||
JSUINT8 prvBuffer[JSON_TYPECONTEXT_PRIVATE_BUFFER_SIZE];
|
||||
int type;
|
||||
void *prv;
|
||||
void *encoder_prv;
|
||||
|
@ -714,7 +714,6 @@ void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t cbName)
|
||||
}
|
||||
|
||||
tc.encoder_prv = enc->prv;
|
||||
tc.prv = (void *) tc.prvBuffer;
|
||||
enc->beginTypeContext(obj, &tc);
|
||||
|
||||
switch (tc.type)
|
||||
|
@ -492,6 +492,7 @@ void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc)
|
||||
|
||||
obj = (PyObject*) _obj;
|
||||
|
||||
tc->prv = PyObject_Malloc(sizeof(TypeContext));
|
||||
pc = (TypeContext *) tc->prv;
|
||||
if (!pc)
|
||||
{
|
||||
@ -725,6 +726,9 @@ INVALID:
|
||||
void Object_endTypeContext(JSOBJ obj, JSONTypeContext *tc)
|
||||
{
|
||||
Py_XDECREF(GET_TC(tc)->newObj);
|
||||
|
||||
PyObject_Free(tc->prv);
|
||||
tc->prv = NULL;
|
||||
}
|
||||
|
||||
const char *Object_getStringValue(JSOBJ obj, JSONTypeContext *tc, size_t *_outLen)
|
||||
|
Loading…
Reference in New Issue
Block a user