mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-19 06:17:45 +01:00
Consolidate path-data encoding into a single file and make it neater.
This commit is contained in:
parent
09742e2e50
commit
b2e1bff782
14 changed files with 302 additions and 95 deletions
|
|
@ -9,6 +9,7 @@ using Penumbra.Collections;
|
|||
using Penumbra.GameData.Data;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Interop.PathResolving;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.String;
|
||||
using Penumbra.String.Classes;
|
||||
|
|
@ -373,14 +374,8 @@ internal unsafe partial record ResolveContext(
|
|||
if (name.IsEmpty)
|
||||
return ByteString.Empty;
|
||||
|
||||
if (stripPrefix && name[0] == (byte)'|')
|
||||
{
|
||||
var pos = name.IndexOf((byte)'|', 1);
|
||||
if (pos < 0)
|
||||
return ByteString.Empty;
|
||||
|
||||
name = name.Substring(pos + 1);
|
||||
}
|
||||
if (stripPrefix && PathDataHandler.Split(name.Span, out var path, out _))
|
||||
name = ByteString.FromSpanUnsafe(path, name.IsNullTerminated, name.IsAsciiLowerCase, name.IsAscii);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue