3 ms·
As for the comments, I would probably write it like this: /* Symbol actually exists */ if ((NULL != getSymbol (symbolName) /* and still to be added
by 1718627440 10mo ago
As for the comments, I would probably write it like this:
/* Symbol actually exists */
if ((NULL != getSymbol (symbolName)
/* and still to be added */
&& (!alreadyReplaced.contains (symbolName))
{
...
Although in this specific case the comments seem like noise to me.
> Technically this performs worse because you lose short-circuiting
Not really, because optimizing compilers are a thing, when this thing is parsed into SSA, there won't be a difference.
- BoorishBears 10mo agoThe compiler would have to determine that these are pure calls which I wouldn't rely on if performance actually matters I just tested a recent gcc at -O2 with a contrived example using strings in an unordered_set: a look-up always occurs if not relying on short-circuiting
- 1718627440 10mo agoTrue, I missed that the calls likely traverse translation units, because this is not how I write code.