Branch once on a dest_address's kind when sizing it
Test / lint (pull_request) Successful in 28s
Test / test (18) (pull_request) Successful in 31s
Test / test (20) (pull_request) Successful in 31s
Test / test (22) (pull_request) Successful in 34s
Test / test (24) (pull_request) Successful in 34s
Test / test (26) (pull_request) Successful in 31s
Mirror / push (push) Successful in 5s
Test / lint (pull_request) Successful in 28s
Test / test (18) (pull_request) Successful in 31s
Test / test (20) (pull_request) Successful in 31s
Test / test (22) (pull_request) Successful in 34s
Test / test (24) (pull_request) Successful in 34s
Test / test (26) (pull_request) Successful in 31s
Mirror / push (push) Successful in 5s
This commit was merged in pull request #37.
This commit is contained in:
+2
-2
@@ -399,11 +399,11 @@ function sizeDestAddresses(addresses: DestAddress[]): Result<{ size: number }> {
|
|||||||
let size = 1;
|
let size = 1;
|
||||||
|
|
||||||
for (const dest of addresses) {
|
for (const dest of addresses) {
|
||||||
const text = 'dl_name' in dest ? cstring.size(dest.dl_name) : cstring.size(dest.destination_addr);
|
const [header, text] = 'dl_name' in dest ? [1, cstring.size(dest.dl_name)] : [3, cstring.size(dest.destination_addr)];
|
||||||
|
|
||||||
if (text.err) return { err: text.err };
|
if (text.err) return { err: text.err };
|
||||||
|
|
||||||
size += ('dl_name' in dest ? 1 : 3) + text.size;
|
size += header + text.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { size };
|
return { size };
|
||||||
|
|||||||
Reference in New Issue
Block a user