Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-02-01 23:49:15 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-02-01 23:49:15 +0300
commit004749fb1c007f0f439cfbdcb7d72771aed426f7 (patch)
tree1afd8c82814d6b1860e362d8c767cbea5771e215 /mcs
parent434df2087e1eff7624453a45aceb965733da9ab2 (diff)
2005-02-01 Atsushi Enomoto <atsushi@ximian.com>
* DataTable.cs : Fixed row comparer. Even if every of the sort target columns are identical for two rows, they should not be regarded as the same unless they are Object.ReferenceEquals. svn path=/trunk/mcs/; revision=39942
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.Data/System.Data/ChangeLog6
-rw-r--r--mcs/class/System.Data/System.Data/DataTable.cs5
2 files changed, 10 insertions, 1 deletions
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
index 35b4ea77010..3d94114bfa5 100644
--- a/mcs/class/System.Data/System.Data/ChangeLog
+++ b/mcs/class/System.Data/System.Data/ChangeLog
@@ -1,5 +1,11 @@
2005-02-01 Atsushi Enomoto <atsushi@ximian.com>
+ * DataTable.cs : Fixed row comparer. Even if every of the sort target
+ columns are identical for two rows, they should not be regarded as
+ the same unless they are Object.ReferenceEquals.
+
+2005-02-01 Atsushi Enomoto <atsushi@ximian.com>
+
* DataRowCollection.cs : on adding a row, should raise
ChangingDataRow() as well as ChangedDataRow().
diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs
index c51a5642f61..2d4ba333ad2 100644
--- a/mcs/class/System.Data/System.Data/DataTable.cs
+++ b/mcs/class/System.Data/System.Data/DataTable.cs
@@ -1701,6 +1701,9 @@ namespace System.Data {
if(!(y is DataRow))
throw new SystemException ("Object to compare is not DataRow: y is " + x.GetType().ToString());
+ if (x == y)
+ return 0;
+
DataRow rowx = (DataRow) x;
DataRow rowy = (DataRow) y;
@@ -1721,7 +1724,7 @@ namespace System.Data {
}
}
}
- return 0;
+ return x.GetHashCode () - y.GetHashCode ();
}
}