Skip to content

Commit

Permalink
simplify blocks by using shorthand notation
Browse files Browse the repository at this point in the history
  • Loading branch information
FND committed Aug 8, 2011
1 parent 15cb43c commit 2ce706a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/readability.rb
Expand Up @@ -46,7 +46,7 @@ def make_html
def content(remove_unlikely_candidates = :default)
@remove_unlikely_candidates = false if remove_unlikely_candidates == false

@html.css("script, style").each { |i| i.remove }
@html.css("script, style").each(&:remove)

remove_unlikely_candidates! if @remove_unlikely_candidates
transform_misused_divs_into_paragraphs!
Expand Down Expand Up @@ -121,7 +121,7 @@ def select_best_candidate(candidates)
end

def get_link_density(elem)
link_length = elem.css("a").map {|i| i.text}.join("").length
link_length = elem.css("a").map(&:text).join("").length
text_length = elem.text.length
link_length / text_length.to_f
end
Expand Down

0 comments on commit 2ce706a

Please sign in to comment.