[Monodevelop-patches-list] r1333 - in trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor: . CodeCompletion

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Apr 1 14:24:17 EST 2004


Author: tberman
Date: 2004-04-01 14:24:17 -0500 (Thu, 01 Apr 2004)
New Revision: 1333

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TextUtilities.cs
Log:
cleanup text utilities a bit


Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-01 08:00:28 UTC (rev 1332)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-01 19:24:17 UTC (rev 1333)
@@ -1,3 +1,8 @@
+2004-04-01  Todd Berman  <tberman at sevenl.net>
+
+	* CodeCompletion/TextUtilities.cs: if we are already caching the string
+	might as well use it.
+
 2004-03-29  Todd Berman  <tberman at sevenl.net>
 
 	* Gui/SourceEditorDisplayBinding.cs: second half of the double clicking

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TextUtilities.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TextUtilities.cs	2004-04-01 08:00:28 UTC (rev 1332)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TextUtilities.cs	2004-04-01 19:24:17 UTC (rev 1333)
@@ -248,14 +248,14 @@
 		{
 			// FIXME: use iters
 			string text = document.Buffer.Text;
-			while (offset > 0 && offset < document.Buffer.Text.Length) {
+			while (offset > 0 && offset < text.Length) {
 				char ch = text [offset];
 				switch (ch) {
 					case '\r':
 					case '\n':
 						return false;
 					case '/':
-						if (document.Buffer.Text[offset + 1] == '/') {
+						if (text[offset + 1] == '/') {
 							return true;
 						}
 						break;
@@ -271,10 +271,10 @@
 			string text = document.Buffer.Text;			
 			int brackets = -1;		
 			bool inString = false;
-			bool inChar   = false;			
+			bool inChar   = false;	
 			bool blockComment = false;
 			
-			while (offset >= 0 && offset < document.Buffer.Text.Length) {
+			while (offset >= 0 && offset < text.Length) {
 				char ch = text [offset];
 				switch (ch) {
 					case '/':




More information about the Monodevelop-patches-list mailing list