From 20f77aee154fabe58c713da5964064778f65dce9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= <mpg@elzevir.fr>
Date: Fri, 5 Nov 2010 19:58:53 +0100
Subject: s/ifelse/table lookup/ part 2

---
 luatexbase-mcb.dtx | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index 43bfef9..c0d8c58 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -640,17 +640,7 @@ function add_to_callback (name,func,description,priority)
         l = {}
         callbacklist[name] = l
         if not lua_callbacks_defaults[name] then
-            if callbacktypes[name] == list then
-                internalregister(name, listhandler(name))
-            elseif callbacktypes[name] == data then
-                internalregister(name, datahandler(name))
-            elseif callbacktypes[name] == simple then
-                internalregister(name, simplehandler(name))
-            elseif callbacktypes[name] == first then
-                internalregister(name, firsthandler(name))
-            else
-                err("unknown callback type")
-            end
+            internalregister(name, handlers[callbacktypes[name]](name))
         end
     end
 %    \end{macrocode}
-- 
cgit v1.2.3

