[patch] ksh: remove silly optimization in assign_command()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[patch] ksh: remove silly optimization in assign_command()

Alexey Dobriyan-2
Index: bin/ksh/syn.c
===================================================================
RCS file: /cvs/src/bin/ksh/syn.c,v
retrieving revision 1.23
diff -u -p -r1.23 syn.c
--- bin/ksh/syn.c 2005/12/11 20:31:21 1.23
+++ bin/ksh/syn.c 2006/03/14 16:38:48
@@ -777,14 +777,12 @@ compile(Source *s)
 static int
 assign_command(char *s)
 {
- char c = *s;
-
  if (Flag(FPOSIX) || !*s)
  return 0;
- return (c == 'a' && strcmp(s, "alias") == 0) ||
-    (c == 'e' && strcmp(s, "export") == 0) ||
-    (c == 'r' && strcmp(s, "readonly") == 0) ||
-    (c == 't' && strcmp(s, "typeset") == 0);
+ return (strcmp(s, "alias") == 0) ||
+    (strcmp(s, "export") == 0) ||
+    (strcmp(s, "readonly") == 0) ||
+    (strcmp(s, "typeset") == 0);
 }
 
 /* Check if we are in the middle of reading an alias */