changeset 746:32a8ddd330f8

Using icompare() instead of toLower().
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 10 Feb 2008 02:14:08 +0100
parents 7299159c3a19
children 00f872d949ea
files trunk/src/dil/doc/Doc.d trunk/src/main.d
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/doc/Doc.d	Sat Feb 09 23:23:01 2008 +0100
+++ b/trunk/src/dil/doc/Doc.d	Sun Feb 10 02:14:08 2008 +0100
@@ -10,7 +10,7 @@
 import dil.Unicode;
 import common;
 
-import tango.text.Ascii : toLower;
+import tango.text.Ascii : icompare;
 
 class DDocComment
 {
@@ -41,7 +41,7 @@
   bool isDitto()
   {
     if (summary && sections.length == 1 &&
-        toLower(strip(summary.text.dup)) == "ditto")
+        icompare(strip(summary.text), "ditto") == 0)
       return true;
     return false;
   }
@@ -68,6 +68,7 @@
 
 /// Strips leading and trailing whitespace characters.
 /// Whitespace: ' ', '\t', '\v', '\f' and '\n'
+/// Returns: a slice into str.
 char[] strip(char[] str)
 {
   if (str.length == 0)
@@ -233,7 +234,7 @@
 
   bool Is(char[] name2)
   {
-    return toLower(name.dup) == name2;
+    return icompare(name, name2) == 0;
   }
 }
 
--- a/trunk/src/main.d	Sat Feb 09 23:23:01 2008 +0100
+++ b/trunk/src/main.d	Sun Feb 10 02:14:08 2008 +0100
@@ -35,7 +35,7 @@
 import tango.io.File;
 import tango.text.Util;
 import tango.time.StopWatch;
-import tango.text.Ascii : toLower;
+import tango.text.Ascii : icompare;
 
 void main(char[][] args)
 {
@@ -100,7 +100,7 @@
         incUndoc = true;
       else if (arg == "-v")
         verbose = true;
-      else if (arg.length > 5 && toLower(arg[$-4..$].dup) == "ddoc")
+      else if (arg.length > 5 && icompare(arg[$-4..$], "ddoc") == 0)
         macroPaths ~= arg;
       else
         filePaths ~= arg;