samedi 1 août 2015

Is an inline if more performant than a normal if?

Using this Inline-if:

freeCache = (freeCache > (2880 * 3)) ? (2880 * 3) : freeCache;

there is a value assignment in every case.

Using this normal if-Statement:

if(this.freeCache > (2880 * 3)) this.freeCache = (2880 * 3)

there should only be a value assignment if the freeCache value is too high.

So which of those is actually more performant?

Aucun commentaire:

Enregistrer un commentaire