diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2002-10-31 06:41:05 +0300 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2002-10-31 06:41:05 +0300 |
commit | 0bd4fc901ac05d78cb0c1ca1b38f7e1122a4806a (patch) | |
tree | e8d2fcb2469588a98686d5f5423f082479ea2036 /mcs/class/System/System.Collections.Specialized | |
parent | d3917c06848e7f6605ae83f3e396192244308a12 (diff) |
2002-10-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* NameValueCollection.cs: fixed Add (NameValueCollection).
svn path=/trunk/mcs/; revision=8694
Diffstat (limited to 'mcs/class/System/System.Collections.Specialized')
-rwxr-xr-x | mcs/class/System/System.Collections.Specialized/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System/System.Collections.Specialized/NameValueCollection.cs | 25 |
2 files changed, 15 insertions, 14 deletions
diff --git a/mcs/class/System/System.Collections.Specialized/ChangeLog b/mcs/class/System/System.Collections.Specialized/ChangeLog index 565d9972c4c..c8983364b21 100755 --- a/mcs/class/System/System.Collections.Specialized/ChangeLog +++ b/mcs/class/System/System.Collections.Specialized/ChangeLog @@ -1,3 +1,7 @@ +2002-10-31 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * NameValueCollection.cs: fixed Add (NameValueCollection). + 2002-09-03 Gonzalo Paniagua Javier <gonzalo@ximian.com> * StringCollection.cs: fixes bug #29791. Thanks to Marcus Urban diff --git a/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs b/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs index 6cdf0197b11..cce56a3d274 100644 --- a/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs +++ b/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs @@ -139,24 +139,21 @@ namespace System.Collections.Specialized{ /// to the current NameValueCollection.</summary> /// LAMESPEC: see description that comes this Add(string, string) - public void Add( NameValueCollection c ){ - + public void Add (NameValueCollection c) + { if (this.IsReadOnly) - throw new NotSupportedException("Collection is read-only"); - if (c==null) - throw new ArgumentNullException(); - - InvalidateCachedArrays(); - ArrayList values = null; + throw new NotSupportedException ("Collection is read-only"); + if (c == null) + throw new ArgumentNullException (); + InvalidateCachedArrays (); int max = c.Count; - for(int i=0; i<max; i++){ - values=(ArrayList)BaseGet(c.GetKey(i)); - if (values==null) - values = new ArrayList(); - values.AddRange((ArrayList)c.BaseGet(i)); + for (int i=0; i < max; i++){ + string key = c.GetKey (i); + string [] values = c.GetValues (i); + foreach (string value in values) + Add (key, value); } - } |