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-02 04:57:02 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-02-02 04:57:02 +0300
commitbd9bdc261603cd4a6badce435f84d573bb185671 (patch)
tree3a42fb1e88feeca5d86c1b45869fbf194389fdbe /mcs
parent8d21746aa4044656772dc493996648e993e9141d (diff)
2005-02-02 Atsushi Enomoto <atsushi@ximian.com>
* DataView.cs : simplify code with UnsortedList. svn path=/trunk/mcs/; revision=39957
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.Data/System.Data/ChangeLog4
-rw-r--r--mcs/class/System.Data/System.Data/DataView.cs10
2 files changed, 7 insertions, 7 deletions
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
index 55e7e9eceae..2eb7245d86a 100644
--- a/mcs/class/System.Data/System.Data/ChangeLog
+++ b/mcs/class/System.Data/System.Data/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-02 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataView.cs : simplify code with UnsortedList.
+
2005-02-01 Atsushi Enomoto <atsushi@ximian.com>
* DataView.cs : Mostly reimplemented.
diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs
index 2a21a3e0f9e..cd0c5b31c71 100644
--- a/mcs/class/System.Data/System.Data/DataView.cs
+++ b/mcs/class/System.Data/System.Data/DataView.cs
@@ -42,7 +42,7 @@ namespace System.Data
SortableColumn [] sortedColumns = null;
DataViewRowState rowState;
// DataRow -> DataRowView
- ListDictionary addNewCache = new ListDictionary ();
+ UnsortedList addNewCache = new UnsortedList ();
OptionalSortedList rowViewPool = new OptionalSortedList ();
bool allowNew = true;
@@ -189,12 +189,8 @@ namespace System.Data
if (recordIndex < rowViewPool.Count)
return (DataRowView) rowViewPool.GetByIndex (recordIndex);
- IEnumerator e = addNewCache.GetEnumerator ();
- int to = recordIndex - rowViewPool.Count;
- for (int i = 0; i <= to; i++)
- if (!e.MoveNext ())
- throw new IndexOutOfRangeException ();
- return (DataRowView) (((DictionaryEntry) e.Current).Value);
+ else
+ return (DataRowView) addNewCache.GetByIndex (recordIndex - rowViewPool.Count);
}
}