From 462a7ed6142961baf770eac8141bbe43192cbd45 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 18 May 2003 20:58:34 +0000 Subject: [PATCH] (indian-regexp-of-hashtbl-keys): Don't sort the argument to regexp-opt. (indian--puthash-char): Use dolist rather than mapc. --- lisp/language/ind-util.el | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lisp/language/ind-util.el b/lisp/language/ind-util.el index 8885960dff8..60008cce48c 100644 --- a/lisp/language/ind-util.el +++ b/lisp/language/ind-util.el @@ -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 ;; 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 @@ FUNCTION will be called 15 times." (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 -- 2.39.2