Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InternalInnerText string concatenation to StringBuilder.Append #334

Merged
merged 1 commit into from Sep 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
}
}
}