mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-22 14:33:06 +01:00
core: Use splitAt() rather than duplicitvely slicing in ScriptParser.sliceConstant() (#5927)
This commit is contained in:
parent
31fbadaeb3
commit
b291e6d31a
1 changed files with 1 additions and 3 deletions
|
@ -183,9 +183,7 @@ sealed abstract class ScriptParser
|
|||
private def sliceConstant(
|
||||
bytesToPushOntoStack: BytesToPushOntoStack,
|
||||
data: ByteVector): (ByteVector, ByteVector) = {
|
||||
val finalIndex = bytesToPushOntoStack.opCode
|
||||
val dataConstant = data.slice(0, finalIndex)
|
||||
(dataConstant, data.slice(finalIndex, data.size))
|
||||
data.splitAt(bytesToPushOntoStack.opCode)
|
||||
}
|
||||
|
||||
/** Parses the bytes in string format, an example input would look like this
|
||||
|
|
Loading…
Add table
Reference in a new issue