1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-05-29 02:26:09 +02:00

Revert "Minor performance optimization"

This reverts commit 510a8fc6d7.
This commit is contained in:
Jonas Tarnstrom 2014-04-16 08:42:48 +02:00
parent 510a8fc6d7
commit 0d76bd0849
3 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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)