Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LengthからByteCountに変更 #81

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/Utf8Utility/Utf8Array.Comparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static int Compare(Utf8Array x, Utf8Array y, StringComparison comparisonT
var xStart = x.DangerousGetReference();
var yStart = y.DangerousGetReference();
var index = 0;
var length = Math.Min(x.Length, y.Length);
var length = Math.Min(x.ByteCount, y.ByteCount);

while (index < length)
{
Expand Down Expand Up @@ -93,7 +93,7 @@ public static int Compare(Utf8Array x, Utf8Array y, StringComparison comparisonT
index++;
}

return x.Length - y.Length;
return x.ByteCount - y.ByteCount;

static int Utf16Compare(ReadOnlySpan<byte> x, ReadOnlySpan<byte> y, StringComparison comparisonType)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Utf8Utility/Utf8Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static Utf8Array Empty
/// <value>
/// バイト数
/// </value>
public int Length => _value.Length;
public int ByteCount => _value.Length;

/// <summary>
/// UTF-8配列が空かどうかを判定します。
Expand Down