eerhardt commented on code in PR #35010:
URL: https://github.com/apache/arrow/pull/35010#discussion_r1163200700


##########
csharp/src/Apache.Arrow/Arrays/StringArray.cs:
##########
@@ -91,5 +93,16 @@ public string GetString(int index, Encoding encoding = 
default)
                     return encoding.GetString(data, bytes.Length);
             }
         }
+
+        // IEnumerable methods
+        public new IEnumerator<string> GetEnumerator()
+        {
+            return Enumerable.Range(0, Length).Select(i => 
GetString(i)).GetEnumerator();

Review Comment:
   Instead of using `Enumerable.Range`, can we instead build `Enumerator` 
structs for these? That will be better performing.
   
   See 
https://github.com/dotnet/runtime/blob/388edb64f004e1c24b350edca43cf9fd2fdb7a4e/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs#L1145-L1215
 for an example.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to