Copilot commented on code in PR #299:
URL: https://github.com/apache/arrow-js/pull/299#discussion_r2403782602


##########
test/generate-test-data.ts:
##########
@@ -720,7 +740,7 @@ function createVariableWidthOffsets64(length: number, 
nullBitmap: Uint8Array, mi
             offsets[i + 1] = offsets[i];
         } else {
             do {
-                offsets[i + 1] = offsets[i] + BigInt(Math.min(max, 
Math.max(min, Math.trunc(rand() * max))));
+                offsets[i + 1] = offsets[i] + BigInt(Math.trunc(Math.min(max, 
Math.max(min, Math.trunc(rand() * max)))));

Review Comment:
   The nested `Math.trunc()` calls are redundant. The outer `Math.trunc()` is 
unnecessary since `Math.min()` and `Math.max()` already return numbers, and the 
inner `Math.trunc()` handles the `rand() * max` conversion.
   ```suggestion
                   offsets[i + 1] = offsets[i] + BigInt(Math.min(max, 
Math.max(min, Math.trunc(rand() * max))));
   ```



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