[asterisk-commits] mnicholson: testsuite/asterisk/trunk r653 - /asterisk/trunk/asttest/lib/lua/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 29 14:00:29 CDT 2010


Author: mnicholson
Date: Thu Jul 29 14:00:25 2010
New Revision: 653

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=653
Log:
Use lua_replace() instead of lua_remove() then lua_insert()

Modified:
    asterisk/trunk/asttest/lib/lua/testlib.c

Modified: asterisk/trunk/asttest/lib/lua/testlib.c
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/asttest/lib/lua/testlib.c?view=diff&rev=653&r1=652&r2=653
==============================================================================
--- asterisk/trunk/asttest/lib/lua/testlib.c (original)
+++ asterisk/trunk/asttest/lib/lua/testlib.c Thu Jul 29 14:00:25 2010
@@ -95,14 +95,14 @@
 			} else if (lua_type(L, -1) == LUA_TTABLE) {
 				/* got a new result */
 				if (new_result) {
-					/* remove the old new result */
-					lua_remove(L, new_result);
-					funcs -= 1;
+					/* replace the new result */
+					lua_replace(L, new_result);
+				} else {
+					/* move the new results under 'funcs' in the stack */
+					lua_insert(L, funcs);
+					new_result = funcs;
+					funcs += 1;
 				}
-				/* move the new results under 'funcs' in the stack */
-				lua_insert(L, funcs);
-				new_result = funcs;
-				funcs += 1;
 			} else {
 				/* got some other error value returned, probably a missing test result */
 				ts = push_ts(L);




More information about the asterisk-commits mailing list