unwire / handsoap

Handsoap is a library for creating SOAP clients in Ruby
http://github.com/unwire/handsoap
225 stars 58 forks source link

Cleanup some cruft that seems to have been left over from old refactorings #19

Closed ferrous26 closed 13 years ago

ferrous26 commented 13 years ago

I was going through the handsoap code to get a better understanding of what it does and I noticed some things that seemed very out of place. These changes do not change how handsoap functions or its interface.

ferrous26 commented 13 years ago

Ok, I changed it.

ferrous26 commented 13 years ago

Explicitly listing the block argument does not make it a required argument; I tested it out on 1.8 and 1.9. Try the following:

 def test &block
   yield if block
 end
 test
 test do puts 1 end

The performance gain is ~5x faster (both 1.8 and 1.9): https://gist.github.com/888491

Though, the method in the patch is quite large, and so the bottleneck is not because the block argument is explicit.

ferrous26 commented 13 years ago

The changes here are now too small, so I'll open a new pull request later on when the changes become significant enough.