[keel] Cleanup string handling

This commit is contained in:
Gary Talent 2023-12-03 22:15:22 -06:00
parent 5cbf789374
commit ce514d586c

View File

@ -178,9 +178,8 @@ ox::Error setRomFs(Context &ctx, ox::UPtr<ox::FileSystem> fs) noexcept {
}
ox::Result<ox::UniquePtr<ox::FileSystem>> loadRomFs(ox::CRStringView path) noexcept {
const auto lastDot = ox_lastIndexOf(path, '.');
const auto fsExt = lastDot != -1 ? substr(path, static_cast<std::size_t>(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<ox::FileSystem32>(rom, 32 * ox::units::MB, unloadRom)};
} else {