Closed (fixed)
Project:
Translation helpers
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2009 at 18:57 UTC
Updated:
1 Sep 2009 at 17:20 UTC
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
Comment #1
nedjoThanks for flagging these. Pls feel free to commit the changes.
Comment #2
markus_petrux commentedThanks! Committed to CVS. :)