log-tree: make ref_filter_match() a helper method