guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. v2.1.0-158-g3c12fc3


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-158-g3c12fc3
Date: Tue, 06 Mar 2012 21:23:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3c12fc359561aedb179a524667ba03481333f482

The branch, master has been updated
       via  3c12fc359561aedb179a524667ba03481333f482 (commit)
       via  24ea9f9c3abb8d9398df4810b815075593ba67c8 (commit)
      from  4164dd6d1f97505748a8476f2524efff87be4bb0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3c12fc359561aedb179a524667ba03481333f482
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 6 22:22:31 2012 +0100

    micro-optimization in (web server)
    
    * module/web/server.scm (extend-response): Micro-optimize to not mutate
      data, and to copy as little as possible.

commit 24ea9f9c3abb8d9398df4810b815075593ba67c8
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 6 22:21:39 2012 +0100

    ports.c: inline get_codepoint
    
    * libguile/ports.c (get_codepoint): Add inline keyword.  It showed up
      high in benchmarks, and it's static, so it's probably important to
      inline.

-----------------------------------------------------------------------

Summary of changes:
 libguile/ports.c      |    2 +-
 module/web/server.scm |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libguile/ports.c b/libguile/ports.c
index a4651ca..8b4dc47 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -1678,7 +1678,7 @@ get_iconv_codepoint (SCM port, scm_t_wchar *codepoint,
    with the byte representation of the codepoint in PORT's encoding, and
    set *LEN to the length in bytes of that representation.  Return 0 on
    success and an errno value on error.  */
-static int
+static SCM_C_INLINE int
 get_codepoint (SCM port, scm_t_wchar *codepoint,
               char buf[SCM_MBCHAR_BUF_SIZE], size_t *len)
 {
diff --git a/module/web/server.scm b/module/web/server.scm
index 42887e6..fbd5d95 100644
--- a/module/web/server.scm
+++ b/module/web/server.scm
@@ -198,11 +198,13 @@ values."
                                          (display str port)))))
 
 (define (extend-response r k v . additional)
+  (define (extend-alist alist k v)
+    (let ((pair (assq k alist)))
+      (acons k v (if pair (delq pair alist) alist))))
   (let ((r (build-response #:version (response-version r)
                            #:code (response-code r)
                            #:headers
-                           (assoc-set! (copy-tree (response-headers r))
-                                       k v)
+                           (extend-alist (response-headers r) k v)
                            #:port (response-port r))))
     (if (null? additional)
         r


hooks/post-receive
-- 
GNU Guile



reply via email to

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