projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c93b59e
)
Worlds smallest optimization
author
benthecarman
<benthecarman@live.com>
Thu, 8 Feb 2024 17:57:13 +0000
(17:57 +0000)
committer
benthecarman
<benthecarman@live.com>
Thu, 8 Feb 2024 22:40:48 +0000
(22:40 +0000)
Preallocate for 8 items in the vec. I chose this value for
1. features
2. description
3. payment hash
4. expire time
5. min_final_cltv
6. payment secret
7. route hint
8. for the memes
lightning-invoice/src/lib.rs
patch
|
blob
|
history
diff --git
a/lightning-invoice/src/lib.rs
b/lightning-invoice/src/lib.rs
index df0412bfc5d3e0d3876b177200527e01fd272678..610f739e57ad9d294610103edd36bbd5155d7109 100644
(file)
--- a/
lightning-invoice/src/lib.rs
+++ b/
lightning-invoice/src/lib.rs
@@
-550,7
+550,7
@@
impl InvoiceBuilder<tb::False, tb::False, tb::False, tb::False, tb::False, tb::F
amount: None,
si_prefix: None,
timestamp: None,
- tagged_fields: Vec::
new(
),
+ tagged_fields: Vec::
with_capacity(8
),
error: None,
phantom_d: core::marker::PhantomData,