mirror of https://github.com/axmolengine/axmol.git
Improve UserDefault code style
This commit is contained in:
parent
a00d594ba0
commit
ba61e83191
|
@ -413,14 +413,20 @@ void UserDefault::lazyInit()
|
||||||
int count = ibs.read<int>();
|
int count = ibs.read<int>();
|
||||||
for (auto i = 0; i < count; ++i)
|
for (auto i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
std::string key(ibs.read_v());
|
|
||||||
std::string value(ibs.read_v());
|
|
||||||
if (_encryptEnabled)
|
if (_encryptEnabled)
|
||||||
{
|
{
|
||||||
|
std::string key(ibs.read_v());
|
||||||
|
std::string value(ibs.read_v());
|
||||||
this->encrypt(key, AES_DECRYPT);
|
this->encrypt(key, AES_DECRYPT);
|
||||||
this->encrypt(value, AES_DECRYPT);
|
this->encrypt(value, AES_DECRYPT);
|
||||||
|
updateValueForKey(key, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string_view key(ibs.read_v());
|
||||||
|
std::string_view value(ibs.read_v());
|
||||||
|
updateValueForKey(key, value);
|
||||||
}
|
}
|
||||||
updateValueForKey(key, value);
|
|
||||||
}
|
}
|
||||||
_realSize = static_cast<int>(ibs.seek(0, SEEK_CUR) - sizeof(udflen_t));
|
_realSize = static_cast<int>(ibs.seek(0, SEEK_CUR) - sizeof(udflen_t));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue