For example, instead of:

  if (translation_supported_type($node->type) && $op == 'delete') {

we could do this:

  if ($op == 'delete' && translation_supported_type($node->type)) {

and translation_supported_type() would only be invoked when $op == 'delete' which happens a lot less than the other nodeapi incarnations.

The same principle could be applies to the following, which happens on 2 different places of the module.

if (translation_supported_type($node->type) && isset($node->tnid)) {

Rather than the above, we could do:

if (isset($node->tnid) && translation_supported_type($node->type)) {

:)

PS: Setting needs work as it might need a proper patch provided.

Comments

nedjo’s picture

Status: Needs work » Reviewed & tested by the community

Thanks for flagging these. Pls feel free to commit the changes.

markus_petrux’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed to CVS. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.