c++ style / avoid copies / const correctness
micro-optimizations to avoid copies