That "optimisation" is actually buggy since table_lookup/2 returns a 2-tuple on success. And by the time you correct for that you realise it's not even an optimisation any more.