comment states that function shall return first nonzero item.
if condition states that if str is not defined and str is not empty we have find an item. That makes no sense since we found an item when str is defined and it is not empty.