n_tty: Replace canon_data with index comparison