```\nfunction \_undelegate(\n    address delegator,\n    address delegatee,\n    uint256 amount\n) internal virtual {\n    uint256 newDelegates = \_delegatesVotesCount[delegator][delegatee] - amount;\n\n    if (newDelegates == 0) {\n        assert(\_delegates[delegator].remove(delegatee)); // Should never fail.\n    }\n```\n