From 8a87be8f4e965391463e0e6a5e95f427f0c24524 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 23 Oct 2015 07:32:52 +0200 Subject: [PATCH] Reader: use positive Boolean, drop unused #map --- lib/github_changelog_generator/reader.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/github_changelog_generator/reader.rb b/lib/github_changelog_generator/reader.rb index f46301f..e489052 100644 --- a/lib/github_changelog_generator/reader.rb +++ b/lib/github_changelog_generator/reader.rb @@ -53,10 +53,10 @@ module GitHubChangelogGenerator @heading_structures.each do |regexp| matches = Regexp.new(regexp).match(heading) - captures.merge!(Hash[matches.names.map.zip(matches.captures)]) unless matches.nil? - - # Try Regular Expressions until you find one that delivers results - break unless matches.nil? + if matches + captures.merge!(Hash[matches.names.zip(matches.captures)]) + break + end end captures