Skip to content

Commit

Permalink
var buf = null eliminated
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Apr 4, 2024
1 parent 9b17889 commit 461c7b3
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ object DifficultySerializer extends ErgoSerializer[NBits] {
* a 4 byte big endian length field, followed by the stated number of bytes representing
* the number in big endian format (with a sign bit).
*/
@SuppressWarnings(Array("NullAssignment"))
private def decodeMPI(mpi: Array[Byte]): BigInteger = {
var buf: Array[Byte] = null // scalastyle:ignore

val length: Int = readUint32BE(mpi).toInt
buf = new Array[Byte](length)
val buf = new Array[Byte](length)
System.arraycopy(mpi, 4, buf, 0, length)

if (buf.length == 0) {
Expand Down

0 comments on commit 461c7b3

Please sign in to comment.