exe/gloc in gloc-0.2.0 vs exe/gloc in gloc-0.2.1
- old
+ new
@@ -66,9 +66,10 @@
end
source_lines = File.read(file).each_line
stats_for_ext.file_count += 1
stats_for_ext.line_count += source_lines.count
stats_for_ext.blank_count += source_lines.grep(BLANKS).count
+ next unless COMMENTS[file_ext] # only scan for comments if a regex exists!
stats_for_ext.comment_count += source_lines.grep(COMMENTS[file_ext]).count
}
source_stats.values.each do |stats_for_ext|
stats_for_ext.code_count = stats_for_ext.line_count - (