From 457842ff8567742d94cb079f439c38403a15d8b8 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Thu, 9 Jul 2015 13:46:23 -0700 Subject: some more cop fixes --- lib/ffi_yajl/benchmark/encode.rb | 10 +++++----- lib/ffi_yajl/benchmark/encode_profile.rb | 2 +- lib/ffi_yajl/benchmark/parse_profile.rb | 2 +- lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb | 2 +- lib/ffi_yajl/ffi/parser.rb | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/ffi_yajl/benchmark/encode.rb b/lib/ffi_yajl/benchmark/encode.rb index 0a33a53..8e5c83f 100644 --- a/lib/ffi_yajl/benchmark/encode.rb +++ b/lib/ffi_yajl/benchmark/encode.rb @@ -48,21 +48,21 @@ module FFI_Yajl ::Benchmark.bmbm { |x| x.report("FFI_Yajl::Encoder.encode (to a String)") { times.times { - output = FFI_Yajl::Encoder.encode(hash) + FFI_Yajl::Encoder.encode(hash) } } ffi_string_encoder = FFI_Yajl::Encoder.new x.report("FFI_Yajl::Encoder#encode (to a String)") { times.times { - output = ffi_string_encoder.encode(hash) + ffi_string_encoder.encode(hash) } } if defined?(Oj) x.report("Oj.dump (to a String)") { times.times { - output = Oj.dump(hash) + Oj.dump(hash) } } end @@ -70,7 +70,7 @@ module FFI_Yajl if defined?(Yajl::Encoder) x.report("Yajl::Encoder.encode (to a String)") { times.times { - output = Yajl::Encoder.encode(hash) + Yajl::Encoder.encode(hash) } } @@ -84,7 +84,7 @@ module FFI_Yajl string_encoder = Yajl::Encoder.new x.report("Yajl::Encoder#encode (to a String)") { times.times { - output = string_encoder.encode(hash) + string_encoder.encode(hash) } } end diff --git a/lib/ffi_yajl/benchmark/encode_profile.rb b/lib/ffi_yajl/benchmark/encode_profile.rb index d993581..6158508 100644 --- a/lib/ffi_yajl/benchmark/encode_profile.rb +++ b/lib/ffi_yajl/benchmark/encode_profile.rb @@ -25,7 +25,7 @@ module FFI_Yajl ffi_string_encoder = FFI_Yajl::Encoder.new PerfTools::CpuProfiler.start("/tmp/ffi_yajl_encode_profile.out") do times.times { - output = ffi_string_encoder.encode(hash) + ffi_string_encoder.encode(hash) } end system("pprof.rb --text /tmp/ffi_yajl_encode_profile.out") diff --git a/lib/ffi_yajl/benchmark/parse_profile.rb b/lib/ffi_yajl/benchmark/parse_profile.rb index dfcbc01..9e53729 100644 --- a/lib/ffi_yajl/benchmark/parse_profile.rb +++ b/lib/ffi_yajl/benchmark/parse_profile.rb @@ -24,7 +24,7 @@ module FFI_Yajl PerfTools::CpuProfiler.start("/tmp/ffi_yajl_encode_profile.out") do times.times { - output = FFI_Yajl::Parser.parse(json) + FFI_Yajl::Parser.parse(json) } end system("pprof.rb --text /tmp/ffi_yajl_encode_profile.out") diff --git a/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb b/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb index db72e45..f71a756 100644 --- a/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb +++ b/lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb @@ -23,7 +23,7 @@ module FFI_Yajl result = RubyProf.profile do times.times { - output = FFI_Yajl::Parser.parse(json) + FFI_Yajl::Parser.parse(json) } end diff --git a/lib/ffi_yajl/ffi/parser.rb b/lib/ffi_yajl/ffi/parser.rb index e3226c0..598fecf 100644 --- a/lib/ffi_yajl/ffi/parser.rb +++ b/lib/ffi_yajl/ffi/parser.rb @@ -143,12 +143,12 @@ module FFI_Yajl ::FFI_Yajl.yajl_config(yajl_handle, :yajl_allow_partial_values, :int, 1) end - if ( stat = ::FFI_Yajl.yajl_parse(yajl_handle, str, str.bytesize) != :yajl_status_ok ) + if ( ::FFI_Yajl.yajl_parse(yajl_handle, str, str.bytesize) != :yajl_status_ok ) # FIXME: dup the error and call yajl_free_error? error = ::FFI_Yajl.yajl_get_error(yajl_handle, 1, str, str.bytesize) raise ::FFI_Yajl::ParseError.new(error) end - if ( stat = FFI_Yajl.yajl_complete_parse(yajl_handle) != :yajl_status_ok ) + if ( ::FFI_Yajl.yajl_complete_parse(yajl_handle) != :yajl_status_ok ) # FIXME: dup the error and call yajl_free_error? error = ::FFI_Yajl.yajl_get_error(yajl_handle, 1, str, str.bytesize) raise ::FFI_Yajl::ParseError.new(error) -- cgit v1.2.1