[Opensrf-commits] r1808 - in trunk/src: libopensrf srfsh (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Oct 5 14:53:06 EDT 2009


Author: scottmk
Date: 2009-10-05 14:53:02 -0400 (Mon, 05 Oct 2009)
New Revision: 1808

Modified:
   trunk/src/libopensrf/osrf_application.c
   trunk/src/srfsh/srfsh.c
Log:
Small performance tweak.

Replaced two occurrences of jsonParseString( "[]" ) with the
equivalant (and faster) call to jsonNewObject( JSON_ARRAY ). 

M    src/libopensrf/osrf_application.c
M    src/srfsh/srfsh.c


Modified: trunk/src/libopensrf/osrf_application.c
===================================================================
--- trunk/src/libopensrf/osrf_application.c	2009-10-05 16:29:57 UTC (rev 1807)
+++ trunk/src/libopensrf/osrf_application.c	2009-10-05 18:53:02 UTC (rev 1808)
@@ -333,8 +333,8 @@
 		osrfLogDebug( OSRF_LOG_MARK,   
 			"Adding responses to stash for atomic method %s", ctx->method->name );
 
-		if( ctx->responses == NULL )												
-			ctx->responses = jsonParseString("[]");							
+		if( ctx->responses == NULL )
+			ctx->responses = jsonNewObjectType( JSON_ARRAY );
 
 		if ( data != NULL )
 			jsonObjectPush( ctx->responses, jsonObjectClone(data) );	

Modified: trunk/src/srfsh/srfsh.c
===================================================================
--- trunk/src/srfsh/srfsh.c	2009-10-05 16:29:57 UTC (rev 1807)
+++ trunk/src/srfsh/srfsh.c	2009-10-05 18:53:02 UTC (rev 1808)
@@ -1021,7 +1021,7 @@
 	osrfAppSession* session = osrfAppSessionClientInit( "opensrf.math" );
 	osrfAppSessionConnect(session);
 
-	jsonObject* params = jsonParseString("[]");
+	jsonObject* params = jsonNewObjectType( JSON_ARRAY );
 	jsonObjectPush(params,jsonNewObject("1"));
 	jsonObjectPush(params,jsonNewObject("2"));
 



More information about the opensrf-commits mailing list