zeroshade commented on code in PR #1198:
URL: https://github.com/apache/iceberg-go/pull/1198#discussion_r3439163232


##########
transforms.go:
##########
@@ -477,6 +484,18 @@ func (t TruncateTransform) Transformer(src Type) 
(func(any) any, error) {
                ErrInvalidArgument, src)
 }
 
+func truncateString(s string, width int) string {
+       for idx := range s {
+               if width == 0 {
+                       return s[:idx]

Review Comment:
   Fair enough, can you just add a comment to the function explaining why we 
need to do the loop like that? We can keep the loop since it's a good point 
that we don't need to do the copy, let's just add the comment so we don't look 
at this later and get confused 😄 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to