improve routing_table::depth() performance