Wednesday, August 28, 2013

Converting Pointers to C++ References in WebKit

Andreas Kling:

It exposes unnecessary null checks by turning them into compile errors.

C++ doesn’t let you null check references, so you have no choice but to remove them. This is awesome, because it means smaller and faster code, both binary and source wise. The CPU doesn’t have to spend time checking if the object is really there, and you don’t have to spend time worrying about what to do if it isn’t.

Comments RSS · Twitter

Leave a Comment