gpgscm: Refactor.
authorJustus Winter <justus@g10code.com>
Fri, 18 Nov 2016 11:51:00 +0000 (12:51 +0100)
committerJustus Winter <justus@g10code.com>
Tue, 22 Nov 2016 11:09:47 +0000 (12:09 +0100)
* tests/gpgscm/scheme.c (opexe_0): Reduce code duplication.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/scheme.c

index 4a83cd5..e011dea 100644 (file)
@@ -2963,16 +2963,16 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
                }
           }
 
-     CASE(OP_LAMBDA1):
-         gc_disable(sc, 1);
-          s_return_enable_gc(sc, mk_closure(sc, sc->value, sc->envir));
-
 #else
      CASE(OP_LAMBDA):     /* lambda */
+         sc->value = sc->code;
+         /* Fallthrough. */
+#endif
+
+     CASE(OP_LAMBDA1):
          gc_disable(sc, 1);
-          s_return_enable_gc(sc, mk_closure(sc, sc->code, sc->envir));
+          s_return_enable_gc(sc, mk_closure(sc, sc->value, sc->envir));
 
-#endif
 
      CASE(OP_MKCLOSURE): /* make-closure */
        x=car(sc->args);