Author: fejj
Date: 2007-03-06 20:03:03 -0500 (Tue, 06 Mar 2007)
New Revision: 73860

Modified:
   
trunk/monodevelop/Extras/CSharpBinding/FormattingStrategy/CSharpIndentEngine.cs
Log:
simplified a nested if-statement block by checking a common case in the outer if



Modified: 
trunk/monodevelop/Extras/CSharpBinding/FormattingStrategy/CSharpIndentEngine.cs
===================================================================
--- 
trunk/monodevelop/Extras/CSharpBinding/FormattingStrategy/CSharpIndentEngine.cs 
    2007-03-07 00:27:43 UTC (rev 73859)
+++ 
trunk/monodevelop/Extras/CSharpBinding/FormattingStrategy/CSharpIndentEngine.cs 
    2007-03-07 01:03:03 UTC (rev 73860)
@@ -152,19 +152,6 @@
                        return engine;
                }
                
-               //int NumLeadingWhiteSpace ()
-               //{
-               //      string line = linebuf.ToString ();
-               //      int n;
-               //      
-               //      for (n = 0; n < line.Length; n++) {
-               //              if (!Char.IsWhiteSpace (line[n]))
-               //                      break;
-               //      }
-               //      
-               //      return n;
-               //}
-               
                void TrimIndent ()
                {
                        switch (stack.PeekInside (0)) {
@@ -644,12 +631,12 @@
                        }
                        
                        if ((inside & (Inside.PreProcessor | 
Inside.StringOrChar | Inside.Comment)) == 0 
-                               && firstNonLwsp != -1) {
-                               if (Char.IsWhiteSpace (c) || c == '(' || c == 
'{' && linebuf.Length > wordStart) {
+                               && firstNonLwsp != -1 && linebuf.Length > 
wordStart) {
+                               if (Char.IsWhiteSpace (c) || c == '(' || c == 
'{') {
                                        string tmp = IsKeyword ();
                                        if (tmp != null)
                                                keyword = tmp;
-                               } else if (c == ':' && linebuf.Length > 
wordStart && IsDefault ()) {
+                               } else if (c == ':' && IsDefault ()) {
                                        keyword = "default";
                                }
                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to