[matchtags addon] Fix inefficiency

Issue #1653