tom322:
isset is always faster than in_array because isset checks only one value from array, and in_array goes through all values
It is theoretically true, but if we speak about the
$userInfo array which is generated in the
bb_func_vthread.php file, then it generates only as much values as are set in the
$viewmaxreplys setting - i.e. the amount of messages per page which obviously rather won't be set up for more than 50. THIS amount actually doesn't affect anything in terms of `in_array` vs. `isset`. If there would be about 50,000 or even 5,000 values then you'd note a difference :)
That's why this optimization wouldn't make a lot of sense... specially because for `getClForums`, $userInfo be substituted as a plain array of values (user IDs). You solution actually "sums up"... umm, not sure what exactly :)
tom322:
nothing was broken and the speed was a little faster
I suppose an impression of changed speed is a placebo effect, or whatever else happened at that moment (for example, less users visited the site in a moment that's why you were having it). I suppose, this function in terms of the value it holds, is hard-to-catch at the speed measuring.