trim_ignored_letters(): Simplify a little.
authorFred Drake <fdrake@acm.org>
Mon, 4 Jan 1999 22:00:56 +0000 (22:00 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 4 Jan 1999 22:00:56 +0000 (22:00 +0000)
Doc/tools/buildindex.py

index e282f3cc61f2050a0ff04cd1ad225a92374498eb..1d50825bebfc857d66faa09e1f143ea46d4215e4 100755 (executable)
@@ -116,14 +116,14 @@ def load(fp):
     return nodes
 
 
-# ignore $ to keep environment variables with the leading letter from the name
-SKIP_LETTERS = "$"
-
 def trim_ignored_letters(s):
+    # ignore $ to keep environment variables with the
+    # leading letter from the name
     s = string.lower(s)
-    while s[0] in SKIP_LETTERS:
-        s = s[1:]
-    return s
+    if s[0] == "$":
+        return s[1:]
+    else:
+        return s
 
 def get_first_letter(s):
     return string.lower(trim_ignored_letters(s)[0])