Optimize check for equals header name and value