You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2022/10/31 06:19:10 UTC

[lucenenet] 02/14: PERFORMANCE: Lucene.Net.Codecs.SimpleText.SimpleTextUtil::Write(): Removed unnecessary ToCharArray() allocation

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit eea43d74b0a72e421cf05276bec9022d4d847674
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Wed Oct 26 19:02:36 2022 +0700

    PERFORMANCE: Lucene.Net.Codecs.SimpleText.SimpleTextUtil::Write(): Removed unnecessary ToCharArray() allocation
---
 src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
index 868ac3736..695e81755 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
@@ -37,7 +37,7 @@ namespace Lucene.Net.Codecs.SimpleText
 
         public static void Write(DataOutput output, string s, BytesRef scratch)
         {
-            UnicodeUtil.UTF16toUTF8(s.ToCharArray(), 0, s.Length, scratch);
+            UnicodeUtil.UTF16toUTF8(s, 0, s.Length, scratch);
             Write(output, scratch);
         }