Pass const references to prevent needless copying.