summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ffi_yajl/parser.rb')
-rw-r--r--lib/ffi_yajl/parser.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ffi_yajl/parser.rb b/lib/ffi_yajl/parser.rb
index da9b704..6029691 100644
--- a/lib/ffi_yajl/parser.rb
+++ b/lib/ffi_yajl/parser.rb
@@ -32,14 +32,14 @@ module FFI_Yajl
# stack used to build up our complex object
#
def stack
- @stack ||= Array.new
+ @stack ||= []
end
#
# stack to keep track of keys as we create nested hashes
#
def key_stack
- @key_stack ||= Array.new
+ @key_stack ||= []
end
def self.parse(obj, *args)
@@ -81,9 +81,7 @@ module FFI_Yajl
# XXX: bug-compat with ruby-yajl
return nil if str == ""
- if str.respond_to?(:read)
- str = str.read
- end
+ str = str.read if str.respond_to?(:read)
# call either the ext or ffi hook
do_yajl_parse(str, yajl_opts)