4 ms·
Not to be too snarky, but I don't think I'd trust somebody who wrote that function to have code where one could "not find any evidence to substantiate security
by ThatGeoGuy 12y ago
Not to be too snarky, but I don't think I'd trust somebody who wrote that function to have code where one could "not find any evidence to substantiate security concerns."
Perhaps this is some sort of style thing specific to javascript, but wouldn't:
function isRetargetingEnabled(){
return (similarproducts.b.enableRetargetingUnit &&
!isRetargetingBlackList());
}
be the better way to write it? Sure say what you want about micro-optimizations, but the function appears to be used in a boolean context, so shouldn't it just return the if condition? Things like this are why I have trouble trusting security claims.
EDIT: Fixed double-negative
- samspot 12y agoI like your style better, but your function doesn't return 0 || 1 (yours returns true || false). I also wouldn't read too much into it. It's unlikely that the same person wrote all the code involved, and many smart people I know write these kinds of functions, no matter how much I complain about it.