Skip to content

Instantly share code, notes, and snippets.

@ender672
Created February 15, 2012 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ender672/1831918 to your computer and use it in GitHub Desktop.
Save ender672/1831918 to your computer and use it in GitHub Desktop.
1.9.3-p0 nokogiri segfault fix
diff --git a/lib/nokogiri/xml/node_set.rb b/lib/nokogiri/xml/node_set.rb
index 37b3848..cb99cdd 100644
--- a/lib/nokogiri/xml/node_set.rb
+++ b/lib/nokogiri/xml/node_set.rb
@@ -234,8 +234,8 @@ module Nokogiri
###
# Iterate over each node, yielding to +block+
- def each(&block)
- 0.upto(length - 1) do |x|
+ def each
+ length.times do |x|
yield self[x]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment