From 6c302b7d1cc8e02c71580a64270c87b044b95ab6 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 3 May 2021 13:43:19 -0400 Subject: [PATCH] [nostalgia/core/userland] Cleanup readObj --- src/nostalgia/core/userland/gfx.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/nostalgia/core/userland/gfx.cpp b/src/nostalgia/core/userland/gfx.cpp index a4761371..e94c8831 100644 --- a/src/nostalgia/core/userland/gfx.cpp +++ b/src/nostalgia/core/userland/gfx.cpp @@ -14,19 +14,10 @@ namespace nostalgia::core { -static ox::Result> readFile(Context *ctx, const ox::FileAddress &file) noexcept { - oxRequire(stat, ctx->rom->stat(file)); - ox::Vector buff(stat.size); - oxReturnError(ctx->rom->read(file, buff.data(), buff.size())); - return ox::move(buff); -} - template -ox::Result readObj(Context *ctx, const ox::FileAddress &file) noexcept { - oxRequire(buff, readFile(ctx, file)); - T t; - oxReturnError(ox::readClaw(buff.data(), buff.size(), &t)); - return ox::move(t); +static ox::Result readObj(Context *ctx, const ox::FileAddress &file) noexcept { + oxRequire(buff, ctx->rom->read(file)); + return ox::readClaw(buff); } ox::Error initConsole(Context *ctx) noexcept {