I don't think this technically counts as even a minor bug, really it is could best be called a "trivial optimization" at best.

14 lines into the article_select_nodes function (counting blank lines, I'd give file line numbers but we've modified extensively so it wouldn't line up) I found this line & find myself quite baffled by it.
$str_tids = implode(',', call_user_func_array('array_merge', $descendant_tids));

Several points (and please don't take any of this personally) please correct me if I've misunderstood anything here:
1. Why do a call by static name on a built-in function?
2. Why do an array_merge like this & then implode?
From looking at the documentation it looks like array_merge when called with one argument just recreates their keys 1,2,3...n (turning {'a'=>'first','second','b'=>'third'} into {1=>'first', 2=>'second', 3=>'third'}) without changing the order of the values. Implode doesn't even care about the keys, so this just seems like extra a rather round about way that could be done with this:
$str_tids = implode(',', $descendant_tids);

AC

Comments

acolflesh’s picture

I just answered my own question, forget it.

acolflesh’s picture