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
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2004-02-08 23:27:04 +0300
committerAtsushi Eno <atsushieno@gmail.com>2004-02-08 23:27:04 +0300
commit8256002451cc979dacd685af4847071754d5a6c9 (patch)
tree6dafbd09dfb68241c4dd1ca9cb474530983c7be7 /mcs/class/System.XML/System.Xml/XmlElement.cs
parente94468c53cd7b80cf105be056bdbbd33a34ffdc2 (diff)
2004-02-08 Atsushi Enomoto <atsushi@ximian.com>
* DTDObjectModel.cs : Limit external entity reference from DTD by 256. foreach elimination. DTDParameterEntityDeclaration should set Root. Compute attribute default value without raising an error. (for non-error reporting reader) * DTDReader.cs : Fixes for the above fixes. foreach elimination. * DTDValidatingReader.cs, NameTable.cs, XmlAttribute.cs, XmlAttributeCollection.cs, XmlChar.cs, XmlConstruct.cs, XmlDocumentFragment.cs, XmlDocumentNavigator.cs, XmlElement.cs, XmlEntityReference.cs, XmlNamedNodeMap.cs, XmlNode.cs, XmlText.cs : foreach elimination. * XmlDocument.cs, XmlSignificantWhitespace.cs, XmlWhitespace.cs : foreach elimination. Removed unnecesary methods. * XmlTextReader.cs : code format refactory. Optimized some methods. foreach elimination. Replaced Stack with string array. Replaced StringBuilder with char array. Removed unnecessary methods. svn path=/trunk/mcs/; revision=22891
Diffstat (limited to 'mcs/class/System.XML/System.Xml/XmlElement.cs')
-rw-r--r--mcs/class/System.XML/System.Xml/XmlElement.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs
index 4b9d553ecd8..11abd0cd6ac 100644
--- a/mcs/class/System.XML/System.Xml/XmlElement.cs
+++ b/mcs/class/System.XML/System.Xml/XmlElement.cs
@@ -96,8 +96,8 @@ namespace System.Xml
FirstChild.Value = value;
else {
if (FirstChild != null) {
- foreach (XmlNode n in ChildNodes)
- this.RemoveChild (n);
+ for (int i = 0; i < ChildNodes.Count; i++)
+ this.RemoveChild (ChildNodes [i]);
}
// creates new Text node
AppendChild (OwnerDocument.CreateTextNode (value));
@@ -212,9 +212,9 @@ namespace System.Xml
Attributes [i].CloneNode (true));
if (deep) {
- foreach (XmlNode child in this.ChildNodes)
- node.AppendChild (child.CloneNode (true));
- } // shallow cloning
+ for (int i = 0; i < ChildNodes.Count; i++)
+ node.AppendChild (ChildNodes [i].CloneNode (true));
+ }
return node;
}