Skip to content

A little optimization in HeaderBasedPacketMerger #585

Description

@haogev6

https://github.com/NordicSemiconductor/Android-BLE-Library/blob/331fee93215c6bbc215e8471e389bfb40f3e5ed4/test/src/main/java/no/nordicsemi/andorid/ble/test/spec/HeaderBasedPacketMerger.kt#L33-L42

This snippet could be refactored to codes below:

ByteArray(buffer.remaining()) 
   .apply { buffer.get(this) } 
   .also { output.write(it) } 
return receivedDataSize - 2 == expectedSize

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions