Closed (fixed)
Project:
Drupal core
Version:
5.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2007 at 21:12 UTC
Updated:
1 Oct 2007 at 00:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
kkaefer commentedComment #2
kkaefer commentedDuh, I should actually syntax-check before posting...
Comment #3
Freso commentedJust curious, but is there a reason to move from
foo ? bar : baztoif foo {bar} else {baz}? Thet()should easily be able to go into the former test, but I don't know if there is any performance or anything to be gained either way, so, really, I'm simply curious. :)Also, again, I'll probably test this in the morrow.
Comment #4
kkaefer commentedWe have shorter and more readable lines. I am not aware of any performance penalties.
Comment #5
Freso commentedRe-rolled to attached patch and fixed problems with parentheses. (Btw, would
if (!empty($i++))be faster thanif ($i++ > 0)? See Guidelines for better performing code.)I'm apparently having some issues with locale.module though, right now, so further testing of the patch will have to wait a wee bit.
Comment #6
kkaefer commentedThanks for rerolling. I doubt that
empty()is faster because$i++ > 0is a very basic integer comparison.Comment #7
Freso commentedUsing a patched potx-cli.php from kkaefer, I did the following:
Having previously tested the patch for b0rkage, I think it does what it says it does, without any glitches that I can see, and probably without affecting performance. Can't see why it shouldn't be RTBC.
Comment #8
gábor hojtsyOh, I noticed this was not translated properly on some sites, but never thought that it is actually not translatable... Hm, good catch. Also lamented on the patch a bit, thinking about moving the t()s back to a ternary assignment. But it would not save much code for us, so committed this if() based version, which is a bit more clear. Thanks!
Setting for porting to 5.x. (Because a new 5.x release might hit the shelfs soon, it might be a good idea to roll this backport sooner then later).
Comment #9
kkaefer commentedThe patch from #2 is code-wise identical with the committed patch and applies to Drupal 5 with an offset of 569 lines.
Comment #10
drummCommitted to 5.x.
Comment #11
(not verified) commented