LuciferYang opened a new pull request, #43641:
URL: https://github.com/apache/spark/pull/43641
### What changes were proposed in this pull request?
The implementation of the `mmutable.ArraySeq.unsafeWrapArray` function is as
follows:
```scala
def unsafeWrapArray[T](x: Array[T]): ArraySeq[T] = ((x: @unchecked) match {
case null => null
case x: Array[AnyRef] => new ofRef[AnyRef](x)
case x: Array[Int] => new ofInt(x)
case x: Array[Double] => new ofDouble(x)
case x: Array[Long] => new ofLong(x)
case x: Array[Float] => new ofFloat(x)
case x: Array[Char] => new ofChar(x)
case x: Array[Byte] => new ofByte(x)
case x: Array[Short] => new ofShort(x)
case x: Array[Boolean] => new ofBoolean(x)
case x: Array[Unit] => new ofUnit(x)
}).asInstanceOf[ArraySeq[T]]
```
The first case of match is null, there is no need to do another manual null
check, so this PR removes it.
### Why are the changes needed?
Remove unnecessary null check from
`ArrayImplicits.SparkArrayOps#toImmutableArraySeq`
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Existing test cases, such as `ArrayImplicitsSuite`.
### Was this patch authored or co-authored using generative AI tooling?
No
--
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]