No matter how much gas i provide this one function it failsas it runs out of gas, i have used a tool to check how much gas it is using and it is not overly high compared to other functions. I cant see the problem in the cde at all. I have even tried re ordering functions but no luck. The function is below someone please help me its one of the last things i need sorted . Thanks in advance.
function revokeAffiliate(address _addr) public onlyOwner returns(bool) {
require(isAffiliate[_addr]);
isAffiliate[_addr] = false;
affiliateCodeToAddr[affiliateCodeOfAddr[_addr]] = address(0);
emit AffiliatePartnershipRevoked(_addr, affiliateCodeOfAddr[_addr]);
affiliateCodeOfAddr[_addr] = "No longer an affiliate partner";
return true;
}