Unverified Commit 1ebeef7f by Nicolás Venturo Committed by GitHub

Remove unnecessary SLOAD. (#1715)

parent b353f7e1
...@@ -13,7 +13,6 @@ library Roles { ...@@ -13,7 +13,6 @@ library Roles {
* @dev Give an account access to this role. * @dev Give an account access to this role.
*/ */
function add(Role storage role, address account) internal { function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account)); require(!has(role, account));
role.bearer[account] = true; role.bearer[account] = true;
...@@ -23,7 +22,6 @@ library Roles { ...@@ -23,7 +22,6 @@ library Roles {
* @dev Remove an account's access to this role. * @dev Remove an account's access to this role.
*/ */
function remove(Role storage role, address account) internal { function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account)); require(has(role, account));
role.bearer[account] = false; role.bearer[account] = false;
......
...@@ -8,7 +8,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) { ...@@ -8,7 +8,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
this.roles = await RolesMock.new(); this.roles = await RolesMock.new();
}); });
it('reverts when querying roles for the null account', async function () { it('reverts when querying roles for the zero account', async function () {
await shouldFail.reverting(this.roles.has(ZERO_ADDRESS)); await shouldFail.reverting(this.roles.has(ZERO_ADDRESS));
}); });
...@@ -31,7 +31,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) { ...@@ -31,7 +31,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
await shouldFail.reverting(this.roles.add(authorized)); await shouldFail.reverting(this.roles.add(authorized));
}); });
it('reverts when adding roles to the null account', async function () { it('reverts when adding roles to the zero account', async function () {
await shouldFail.reverting(this.roles.add(ZERO_ADDRESS)); await shouldFail.reverting(this.roles.add(ZERO_ADDRESS));
}); });
}); });
...@@ -54,7 +54,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) { ...@@ -54,7 +54,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
await shouldFail.reverting(this.roles.remove(anyone)); await shouldFail.reverting(this.roles.remove(anyone));
}); });
it('reverts when removing roles from the null account', async function () { it('reverts when removing roles from the zero account', async function () {
await shouldFail.reverting(this.roles.remove(ZERO_ADDRESS)); await shouldFail.reverting(this.roles.remove(ZERO_ADDRESS));
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment