Minor Solidity suggestion

Just reading through this and figured I'd suggest a more concise snippet.
This commit is contained in:
Dave Hoover 2019-03-07 15:18:27 -06:00 committed by GitHub
parent 8bd397e2eb
commit 789477bfbf

View File

@ -26,7 +26,7 @@ contract Contract {
function add_address(address addr) public { function add_address(address addr) public {
bool exists = addresses[addr] > 0; bool exists = addresses[addr] > 0;
addresses[addr] = addresses[addr] + 1; addresses[addr]++;
if (!exists) { if (!exists) {
emit AddressAdded(addr, ++num_addresses); emit AddressAdded(addr, ++num_addresses);
} }