From 86be1d430bbf2cde32c46c4c924eaf11a2fd7cca Mon Sep 17 00:00:00 2001 From: finphie <19237170+finphie@users.noreply.github.com> Date: Sat, 6 Nov 2021 05:23:23 +0900 Subject: [PATCH] =?UTF-8?q?Length=E3=81=8B=E3=82=89ByteCount=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Utf8Utility/Utf8Array.Comparison.cs | 4 ++-- Source/Utf8Utility/Utf8Array.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Utf8Utility/Utf8Array.Comparison.cs b/Source/Utf8Utility/Utf8Array.Comparison.cs index c2e5da8..866fa03 100644 --- a/Source/Utf8Utility/Utf8Array.Comparison.cs +++ b/Source/Utf8Utility/Utf8Array.Comparison.cs @@ -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) { @@ -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 x, ReadOnlySpan y, StringComparison comparisonType) { diff --git a/Source/Utf8Utility/Utf8Array.cs b/Source/Utf8Utility/Utf8Array.cs index 69587ca..010d62b 100644 --- a/Source/Utf8Utility/Utf8Array.cs +++ b/Source/Utf8Utility/Utf8Array.cs @@ -125,7 +125,7 @@ public static Utf8Array Empty /// /// バイト数 /// - public int Length => _value.Length; + public int ByteCount => _value.Length; /// /// UTF-8配列が空かどうかを判定します。