Avoid calling GetPointer() multiple times in a row