summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Court`es2007-03-27 15:14:28 +0000
committerLudovic Court`es2007-03-27 15:14:28 +0000
commitfcfe941d8f5b07500af5655aefc30a2d4babbdc9 (patch)
treebaf0187861562d1d1e76b9183898cb08a776c6cb /src
parent13fa68c13373e4f34d74935e3c6650d637d40541 (diff)
downloadskribilo-fcfe941d8f5b07500af5655aefc30a2d4babbdc9.tar.gz
skribilo-fcfe941d8f5b07500af5655aefc30a2d4babbdc9.tar.lz
skribilo-fcfe941d8f5b07500af5655aefc30a2d4babbdc9.zip
Slightly optimized `make-string-replace'.
* src/guile/skribilo/utils/strings.scm (%make-general-string-replace): Removed the `let'... git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-28
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/utils/strings.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/guile/skribilo/utils/strings.scm b/src/guile/skribilo/utils/strings.scm
index e8e8f8f..379464d 100644
--- a/src/guile/skribilo/utils/strings.scm
+++ b/src/guile/skribilo/utils/strings.scm
@@ -111,7 +111,7 @@
(define (%make-general-string-replace lst)
;; The general version
- (let ((chars (make-hash-table)))
+ (let ((chars (make-hash-table 200)))
;; Setup a hash table equivalent to LST.
(for-each (lambda (chr)
@@ -124,8 +124,8 @@
(lambda (str)
(let ((out (open-output-string)))
(string-for-each (lambda (ch)
- (let ((res (hashq-ref chars ch #f)))
- (display (if res res ch) out)))
+ (display (or (hashq-ref chars ch #f) ch)
+ out))
str)
(get-output-string out)))))