when we own the intmap we can reuse it rather than allocating new memory