Commit 1158a171 authored by Lioncache's avatar Lioncache

CFontImageDef: Collapse IsLoaded() into a std::all_of call

Same behavior, less code. C++20 ranges will allow shortening this in the
parent 6063ec25
#include "Runtime/GuiSys/CFontImageDef.hpp"
#include <algorithm>
#include "Runtime/Graphics/CTexture.hpp"
namespace urde {
......@@ -19,10 +21,7 @@ CFontImageDef::CFontImageDef(const TToken<CTexture>& tex, const zeus::CVector2f&
bool CFontImageDef::IsLoaded() const {
for (const TToken<CTexture>& tok : x4_texs)
if (!tok.IsLoaded())
return false;
return true;
return std::all_of(x4_texs.cbegin(), x4_texs.cend(), [](const auto& token) { return token.IsLoaded(); });
s32 CFontImageDef::CalculateBaseline() const {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment