[Monodevelop-patches-list] r531 - trunk/MonoDevelop/src/Main/Base/Services/ParserService

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Jan 17 20:44:50 EST 2004


Author: benm
Date: 2004-01-17 20:44:49 -0500 (Sat, 17 Jan 2004)
New Revision: 531

Modified:
   trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs
Log:
file streams are already buffered, silly

Modified: trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs	2004-01-18 00:55:42 UTC (rev 530)
+++ trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs	2004-01-18 01:44:49 UTC (rev 531)
@@ -255,20 +255,21 @@
 
 		public void LoadProxyDataFile()
 		{
-			if (!File.Exists(codeCompletionProxyFile)) {
-				return;
+			if (!File.Exists (codeCompletionProxyFile))
+				return;
+			
+			using (FileStream fs = File.OpenRead (codeCompletionProxyFile)) {
+				BinaryReader reader = new BinaryReader (fs);
+				while (true) {
+					try {
+						ClassProxy newProxy = new ClassProxy(reader);
+						classProxies.Add(newProxy);
+						AddClassToNamespaceList(newProxy);
+					} catch (Exception) {
+						break;
+					}
+				}
 			}
-			BinaryReader reader = new BinaryReader(new BufferedStream(new FileStream(codeCompletionProxyFile, FileMode.Open, FileAccess.Read, FileShare.Read)));
-			while (true) {
-				try {
-					ClassProxy newProxy = new ClassProxy(reader);
-					classProxies.Add(newProxy);
-					AddClassToNamespaceList(newProxy);
-				} catch (Exception) {
-					break;
-				}
-			}
-			reader.Close();
 		}
 		
 		void LoadThread()




More information about the Monodevelop-patches-list mailing list