aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Court`es2007-03-28 08:45:48 +0000
committerLudovic Court`es2007-03-28 08:45:48 +0000
commit97305e584f34ed7eeda7a0dff36db71274d4c561 (patch)
treee10f5958ced0444ff7675f8c74d57a42788a5b3d
parent3c3f0cdecb1b037447bb4cb222ac5a34a8634a09 (diff)
parentfcfe941d8f5b07500af5655aefc30a2d4babbdc9 (diff)
downloadskribilo-97305e584f34ed7eeda7a0dff36db71274d4c561.tar.gz
skribilo-97305e584f34ed7eeda7a0dff36db71274d4c561.tar.lz
skribilo-97305e584f34ed7eeda7a0dff36db71274d4c561.zip
Slightly optimized `make-string-replace'.
* src/guile/skribilo/utils/strings.scm (%make-general-string-replace): Removed the `let'... git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-69
-rw-r--r--ChangeLog17
-rw-r--r--src/guile/skribilo/utils/strings.scm6
2 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d06f512..9e52309 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,23 @@
# arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2
#
+2007-03-28 08:45:48 GMT Ludovic Court`es <ludovic.courtes@laas.fr> patch-69
+
+ Summary:
+ Slightly optimized `make-string-replace'.
+ Revision:
+ skribilo--devo--1.2--patch-69
+
+ * src/guile/skribilo/utils/strings.scm (%make-general-string-replace):
+ Removed the `let'...
+
+ modified files:
+ ChangeLog src/guile/skribilo/utils/strings.scm
+
+ new patches:
+ lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-28
+
+
2007-03-28 08:44:53 GMT Ludovic Court`es <ludovic.courtes@laas.fr> patch-68
Summary:
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)))))