Codechange: use AsIntSetting()->Read() wrapper if possible (#9324)

This commit is contained in:
Patric Stout
2021-05-31 10:56:06 +02:00
committed by GitHub
parent 043a544248
commit 921ab68a48
2 changed files with 3 additions and 6 deletions

View File

@@ -254,9 +254,8 @@ static_assert(lengthof(_news_type_data) == NT_END);
NewsDisplay NewsTypeData::GetDisplay() const
{
const SettingDesc *sd = GetSettingFromName(this->name);
assert(sd != nullptr);
void *ptr = GetVariableAddress(nullptr, &sd->save);
return (NewsDisplay)ReadValue(ptr, sd->save.conv);
assert(sd != nullptr && sd->IsIntSetting());
return (NewsDisplay)sd->AsIntSetting()->Read(nullptr);
}
/** Window class displaying a news item. */