emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 004f4fc 3/3: Simplify module_make_function


From: Paul Eggert
Subject: [Emacs-diffs] emacs-25 004f4fc 3/3: Simplify module_make_function
Date: Tue, 24 Nov 2015 03:01:56 +0000

branch: emacs-25
commit 004f4fc9d48f141f920e9ae9399f2b0e585edf9c
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Simplify module_make_function
    
    * src/emacs-module.c (module_make_function):
    Simplify by calling build_unibyte_string.
---
 src/emacs-module.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/emacs-module.c b/src/emacs-module.c
index 209f99b..11aefc3 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -387,16 +387,11 @@ module_make_function (emacs_env *env, ptrdiff_t 
min_arity, ptrdiff_t max_arity,
   envptr->data = data;
 
   Lisp_Object envobj = make_save_ptr (envptr);
-  Lisp_Object doc;
-  if (documentation == NULL)
-    doc = Qnil;
-  else
-    {
-      ptrdiff_t nbytes = strlen (documentation);
-      doc = make_unibyte_string (documentation, nbytes);
-      doc = code_convert_string_norecord (doc, Qutf_8, false);
-    }
-
+  Lisp_Object doc
+    = (documentation
+       ? code_convert_string_norecord (build_unibyte_string (documentation),
+                                      Qutf_8, false)
+       : Qnil);
   Lisp_Object ret = list4 (Qlambda,
                            list2 (Qand_rest, Qargs),
                            doc,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]