Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use scala Int.box instead of Integer constructors #4338

Merged
merged 4 commits into from
Dec 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ object RapidsShuffleTestHelper extends MockitoSugar with Arm {
}

def withMockContiguousTable[T](numRows: Long)(body: ContiguousTable => T): T = {
val rows: Seq[Integer] = (0 until numRows.toInt).map(new Integer(_))
val rows: Seq[Integer] = (0 until numRows.toInt).map(Int.box)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
val rows: Seq[Integer] = (0 until numRows.toInt).map(Int.box)
val rows: Seq[Integer] = (0 until numRows).map(Int.box)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, that was a bad comment, scalac won't do a silent lossy conversion for us. I'll undo it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gerashegalov no problem, the constructor (I was trying not to use) also came back with the revert, but I changed it back to Int.box. Please take another look!

withResource(ColumnVector.fromBoxedInts(rows:_*)) { cvBase =>
cvBase.incRefCount()
val gpuCv = GpuColumnVector.from(cvBase, IntegerType)
Expand Down