Revision: 54
Author: carlosga_fb
Date: 2006-03-27 04:13:20 -0800 (Mon, 27 Mar 2006)
ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=54&view=rev
Log Message:
-----------
?\194?\183 Changed the loop used in the IndexOf(string) method
Modified Paths:
--------------
trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgParameterCollection.cs
Modified: trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgParameterCollection.cs
===================================================================
--- trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgParameterCollection.cs 2006-03-27 12:12:35 UTC (rev 53)
+++ trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgParameterCollection.cs 2006-03-27 12:13:20 UTC (rev 54)
@@ -221,18 +221,15 @@
public override int IndexOf(string parameterName)
{
- int index = 0;
+ for (int i = 0; i < this.Count; i++)
+ {
+ if (((PgParameter)this[i]).ParameterName == parameterName)
+ {
+ return i;
+ }
+ }
- foreach (PgParameter item in this.parameters)
- {
- if (item.ParameterName == parameterName)
- {
- return index;
- }
- index++;
- }
-
- return -1;
+ return -1;
}
public override void Insert(int index, object value)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|