zeromq / rbzmq

Ruby binding for 0MQ
http://www.zeromq.org/bindings:ruby
247 stars 43 forks source link

Remove unneeded dereference of string length. #15

Closed jamesladd closed 13 years ago

jamesladd commented 13 years ago

Its a small thing, but there is no need to dereference the string length twice.

bwbuchanan commented 13 years ago

Does the compiler not perform this optimization anyway?

jamesladd commented 13 years ago

The compiler doesn't - I listed the assembler generated. In this particular case the saving is just a pointer dereference, and probably hardly worth the patch. However - if the call had been a 'strlen' then the saving would be worth while.

On Tue, Oct 18, 2011 at 4:27 PM, Brian Buchanan < reply@reply.github.com>wrote:

Does the compiler not perform this optimization anyway?

Reply to this email directly or view it on GitHub: https://github.com/zeromq/rbzmq/pull/15#issuecomment-2438193