[development] performance foo

Keegan Quinn keegan at thebasement.org
Wed Dec 14 20:46:08 UTC 2005


On Wed, Dec 14, 2005 at 12:32:27PM -0800, Neil Drumm wrote:
> Chris Johnson wrote:
> >Interesting idea.  So I rewrote object2array() and better() like this:
> >
> >function object2array($object) {
> >    return get_object_vars($object);
> >}
> >
> >function better($object) {
> >    return (array) $object;
> >}
> 
> Why do we even need these one-line functions? Can't the calling code 
> just do the casting?

I just finished posting the same thought in a comment on the issue[0].

Seems like a good idea to me...  Extraneous function calls are bad.

Thanks,

-- 
Keegan Quinn  <keegan at thebasement.org>
CEO, Producer
the basement productions
http://www.thebasement.org

[0] http://drupal.org/node/41169

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.drupal.org/pipermail/development/attachments/20051214/3b8a7c54/attachment.pgp


More information about the development mailing list