Merge pull request #1490 from adamhathcock/fix/legacy-startswith-char

Fix netstandard2.0/net48 build in writable archive key normalisation
This commit is contained in:
Adam Hathcock
2026-11-09 11:26:03 +00:00
committed by GitHub

View File

@@ -170,7 +170,7 @@ public abstract partial class AbstractWritableArchive<TEntry, TVolume, TOptions>
}
return key.Trim('/');
}
return key.StartsWith('/') ? key.Substring(1) : key;
return key.Length > 0 && key[0] == '/' ? key.Substring(1) : key;
}
ValueTask IWritableAsyncArchive.RemoveEntryAsync(IArchiveEntry entry) =>