[keel] Cleanup string handling
This commit is contained in:
parent
5cbf789374
commit
ce514d586c
@ -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 {
|
ox::Result<ox::UniquePtr<ox::FileSystem>> loadRomFs(ox::CRStringView path) noexcept {
|
||||||
const auto lastDot = ox_lastIndexOf(path, '.');
|
auto const lastDot = ox::lastIndexOf(path, '.');
|
||||||
const auto fsExt = lastDot != -1 ? substr(path, static_cast<std::size_t>(lastDot)) : "";
|
if (!lastDot.error && substr(path, lastDot.value) == ".oxfs") {
|
||||||
if (ox_strcmp(fsExt, ".oxfs") == 0) {
|
|
||||||
oxRequire(rom, loadRom(path));
|
oxRequire(rom, loadRom(path));
|
||||||
return {ox::make_unique<ox::FileSystem32>(rom, 32 * ox::units::MB, unloadRom)};
|
return {ox::make_unique<ox::FileSystem32>(rom, 32 * ox::units::MB, unloadRom)};
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user