changeset 51078:39435a35a003

(indian-regexp-of-hashtbl-keys): Don't sort the argument to regexp-opt. (indian--puthash-char): Use dolist rather than mapc.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 18 May 2003 20:58:34 +0000
parents aafee8ba3f90
children bd6dedbdc53f
files lisp/language/ind-util.el
diffstat 1 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/language/ind-util.el	Sun May 18 19:34:14 2003 +0000
+++ b/lisp/language/ind-util.el	Sun May 18 20:58:34 2003 +0000
@@ -1,6 +1,6 @@
 ;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- coding: iso-2022-7bit; -*-
 
-;; Copyright (C) 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2003 Free Software Foundation, Inc.
 
 ;; Maintainer:  KAWABATA, Taichi <kawabata@m17n.org>
 ;; Keywords: multilingual, Indian, Devanagari
@@ -42,14 +42,9 @@
 
 (defun indian-regexp-of-hashtbl-keys (hashtbl)
   "Returns the regular expression of hashtable keys."
-  (let ((max-specpdl-size 1000))
-    (regexp-opt
-     (sort
-      (let (dummy)
-	(maphash (function (lambda (key val) (setq dummy (cons key dummy))))
-		 hashtbl)
-	dummy)
-      (function (lambda (x y) (> (length x) (length y))))))))
+  (let (keys)
+    (maphash (lambda (key val) (push key keys)) hashtbl)
+    (regexp-opt keys)))
 
 (defvar indian-dev-base-table
   '(
@@ -414,10 +409,8 @@
       (if (stringp trans-char) (setq trans-char (list trans-char)))
       (if (char-valid-p char) (setq char (char-to-string char)))
       (puthash char (car trans-char) encode-hash)
-      (mapc
-       (lambda (trans)
-	 (puthash trans char decode-hash))
-       trans-char))))
+      (dolist (trans trans-char)
+	 (puthash trans char decode-hash)))))
 
 (defun indian--map (f l1 l2)
   (while l1