mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Fixes.
This commit is contained in:
parent
8d2e84eecf
commit
581b91b337
13 changed files with 123 additions and 52 deletions
|
|
@ -20,7 +20,14 @@ public readonly struct Utf8RelPath : IEquatable< Utf8RelPath >, IComparable< Utf
|
|||
|
||||
|
||||
public static explicit operator Utf8RelPath( string s )
|
||||
=> FromString( s, out var p ) ? p : Empty;
|
||||
{
|
||||
if( !FromString( s, out var p ) )
|
||||
{
|
||||
return Empty;
|
||||
}
|
||||
|
||||
return new Utf8RelPath( p.Path.AsciiToLower() );
|
||||
}
|
||||
|
||||
public static bool FromString( string? s, out Utf8RelPath path )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public sealed unsafe partial class Utf8String
|
|||
var length = Length;
|
||||
var newPtr = ByteStringFunctions.CopyString( _path, length );
|
||||
var numReplaced = ByteStringFunctions.Replace( newPtr, length, from, to );
|
||||
return new Utf8String().Setup( newPtr, length, numReplaced > 0 ? _crc32 : null, true, true, IsAsciiLowerInternal, IsAsciiInternal );
|
||||
return new Utf8String().Setup( newPtr, length, numReplaced == 0 ? _crc32 : null, true, true, IsAsciiLowerInternal, IsAsciiInternal );
|
||||
}
|
||||
|
||||
// Join a number of strings with a given byte between them.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue