From ce514d586cfdcb86710472cc2aa33390937e46f8 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 3 Dec 2023 22:15:22 -0600 Subject: [PATCH] [keel] Cleanup string handling --- src/keel/media.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/keel/media.cpp b/src/keel/media.cpp index 46a36d93..4af8cb0d 100644 --- a/src/keel/media.cpp +++ b/src/keel/media.cpp @@ -178,9 +178,8 @@ ox::Error setRomFs(Context &ctx, ox::UPtr fs) noexcept { } ox::Result> loadRomFs(ox::CRStringView path) noexcept { - const auto lastDot = ox_lastIndexOf(path, '.'); - const auto fsExt = lastDot != -1 ? substr(path, static_cast(lastDot)) : ""; - if (ox_strcmp(fsExt, ".oxfs") == 0) { + auto const lastDot = ox::lastIndexOf(path, '.'); + if (!lastDot.error && substr(path, lastDot.value) == ".oxfs") { oxRequire(rom, loadRom(path)); return {ox::make_unique(rom, 32 * ox::units::MB, unloadRom)}; } else {