Skip to content

Commit

Permalink
Remove uneccessary allocations in Inscription Script Creation (#3039)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRubin authored Jan 23, 2024
1 parent df04d35 commit e967a8c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/inscriptions/inscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use {
super::*,
anyhow::ensure,
bitcoin::{
blockdata::{
opcodes,
script::{self, PushBytesBuf},
},
blockdata::{opcodes, script},
ScriptBuf,
},
brotli::enc::{writer::CompressorWriter, BrotliEncoderParams},
Expand Down Expand Up @@ -141,7 +138,7 @@ impl Inscription {
if let Some(body) = &self.body {
builder = builder.push_slice(envelope::BODY_TAG);
for chunk in body.chunks(MAX_SCRIPT_ELEMENT_SIZE) {
builder = builder.push_slice(PushBytesBuf::try_from(chunk.to_vec()).unwrap());
builder = builder.push_slice::<&script::PushBytes>(chunk.try_into().unwrap());
}
}

Expand Down

0 comments on commit e967a8c

Please sign in to comment.