summaryrefslogtreecommitdiff
path: root/lib/yaml/rubytypes.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-16 02:16:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-16 02:16:43 +0000
commitd8d2fe124a997668edcfe24bc312d77138939d86 (patch)
treeb90f1b1b70f692b84d6e6b7fcb0f5ad3962a9b8f /lib/yaml/rubytypes.rb
parentd385078b46fcd9fad184d4bdbb89fa34ebd82d14 (diff)
* lib/yaml/rubytypes.rb (String#is_binary_data?): use Integer#fdiv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/rubytypes.rb')
-rw-r--r--lib/yaml/rubytypes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index eebf027135..c71b704b43 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -143,7 +143,7 @@ class String
to_yaml_style or not to_yaml_properties.empty? or self =~ /\n.+/
end
def is_binary_data?
- ( self.count( "^ -~", "^\r\n" ) / self.size > 0.3 || self.count( "\x00" ) > 0 ) unless empty?
+ ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
end
def String.yaml_new( klass, tag, val )
val = val.unpack("m")[0] if tag == "tag:yaml.org,2002:binary"