Skip to content

Use mutable empty strings when needed #981

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/github_changelog_generator/generator/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def generate_entry_between_tags(older_tag, newer_tag)

if newer_tag.nil? && filtered_issues.empty? && filtered_pull_requests.empty?
# do not generate empty unreleased section
return ""
return +""
end

newer_tag_link, newer_tag_name, newer_tag_time = detect_link_tag_time(newer_tag)
Expand Down Expand Up @@ -128,7 +128,7 @@ def generate_entries_for_all_tags
end

def generate_unreleased_entry
entry = ""
entry = +""
if options[:unreleased]
start_tag = @filtered_tags[0] || @sorted_tags.last
unreleased_entry = generate_entry_between_tags(start_tag, nil)
Expand Down Expand Up @@ -166,7 +166,7 @@ def remove_old_fixed_string(log)
# messages of the same wording are removed.
# @param log [String]
def insert_fixed_string(log)
ins = ""
ins = +""
ins += @options[:frontmatter] if @options[:frontmatter]
ins += "#{@options[:header]}\n\n"
log.insert(0, ins)
Expand Down
2 changes: 1 addition & 1 deletion lib/github_changelog_generator/generator/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize(opts = {})
#
# @return [String] Generated section content
def generate_content
content = ""
content = +""

if @issues.any?
content += "#{@prefix}\n\n" unless @options[:simple_list] || @prefix.blank?
Expand Down