Skip to content

Commit

Permalink
Merge pull request #334 from Tora-Bora/patch-1
Browse files Browse the repository at this point in the history
InternalInnerText string concatenation to StringBuilder.Append
  • Loading branch information
JonathanMagnan committed Sep 30, 2019
2 parents 5a725a0 + e36940e commit 95782b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/HtmlAgilityPack.Shared/HtmlNode.cs
Expand Up @@ -3,7 +3,7 @@
// Forum & Issues: https://github.com/zzzprojects/html-agility-pack
// License: https://github.com/zzzprojects/html-agility-pack/blob/master/LICENSE
// More projects: http://www.zzzprojects.com/
// Copyright © ZZZ Projects Inc. 2014 - 2017. All rights reserved.
// Copyright © ZZZ Projects Inc. 2014 - 2017. All rights reserved.

using System;
using System.Collections;
Expand Down Expand Up @@ -423,10 +423,10 @@ internal virtual string InternalInnerText(bool isDisplayScriptingText)
if (!HasChildNodes || ( _isHideInnerText && !isDisplayScriptingText))
return string.Empty;

string s = null;
var s = new StringBuilder;
foreach (HtmlNode node in ChildNodes)
s += node.InternalInnerText(isDisplayScriptingText);
return s;
s.Append(node.InternalInnerText(isDisplayScriptingText));
return s.ToString();
}

/// <summary>Gets direct inner text.</summary>
Expand Down Expand Up @@ -2487,4 +2487,4 @@ private bool IsEmpty(IEnumerable en)

#endregion
}
}
}

0 comments on commit 95782b8

Please sign in to comment.