I don't think there's a need to iterate through all the items values. Just check if the two we're interested in exist?

Also, could you add a test for the issue I pointed out that's been fixed here?