From 211c624aca3e3b8ba05d220e60429373fd9871a9 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sun, 13 Nov 2011 05:41:33 +0000 Subject: [PATCH] smjs_get_elinks_object: drop jsobj temp variable After recent simplifications, the jsobj variable is no longer necessary. Instead of assigning it a value and then returning it, just return the value that was being assigned to it. --- src/scripting/smjs/elinks_object.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/scripting/smjs/elinks_object.c b/src/scripting/smjs/elinks_object.c index dd87db9cd..3807516cc 100644 --- a/src/scripting/smjs/elinks_object.c +++ b/src/scripting/smjs/elinks_object.c @@ -198,18 +198,13 @@ static const spidermonkeyFunctionSpec elinks_funcs[] = { static JSObject * smjs_get_elinks_object(void) { - JSObject *jsobj; - assert(smjs_ctx); assert(smjs_global_object); - jsobj = spidermonkey_InitClass(smjs_ctx, smjs_global_object, NULL, - (JSClass *) &elinks_class, NULL, 0, - (JSPropertySpec *) elinks_props, - elinks_funcs, NULL, NULL); - if (!jsobj) return NULL; - - return jsobj; + return spidermonkey_InitClass(smjs_ctx, smjs_global_object, NULL, + (JSClass *) &elinks_class, NULL, 0, + (JSPropertySpec *) elinks_props, + elinks_funcs, NULL, NULL); } void