demmt: optimize check_addresses_terse