fix: error: -Werror=misleading-indentation

Compilation of bitmonero on Arch with gcc 6.1 results in the following
error:

/home/mwo/bitmonero/tests/unit_tests/hardfork.cpp: In member function ‘virtual void TestDB::set_hard_fork_version(uint64_t, uint8_t)’:
/home/mwo/bitmonero/tests/unit_tests/hardfork.cpp:132:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (versions.size() <= height) versions.resize(height+1); versions[height] = version;

This can be fixed by simply unfolding this line into three lines.
This commit is contained in:
moneroexample 2016-05-18 12:51:28 +08:00 committed by redfish
parent c2d7300d2e
commit de030d99a5

View File

@ -129,7 +129,9 @@ public:
return starting_height[version];
}
virtual void set_hard_fork_version(uint64_t height, uint8_t version) {
if (versions.size() <= height) versions.resize(height+1); versions[height] = version;
if (versions.size() <= height)
versions.resize(height+1);
versions[height] = version;
}
virtual uint8_t get_hard_fork_version(uint64_t height) const {
return versions[height];