mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
script: remove repeated tal_count calls from scripteq
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
This commit is contained in:
parent
5dd8d933d5
commit
5dee5ce178
1 changed files with 4 additions and 8 deletions
|
@ -993,12 +993,8 @@ bool is_anchor_witness_script(const u8 *script, size_t script_len)
|
||||||
|
|
||||||
bool scripteq(const u8 *s1, const u8 *s2)
|
bool scripteq(const u8 *s1, const u8 *s2)
|
||||||
{
|
{
|
||||||
memcheck(s1, tal_count(s1));
|
size_t s1_len = tal_count(s1), s2_len = tal_count(s2);
|
||||||
memcheck(s2, tal_count(s2));
|
memcheck(s1, s1_len);
|
||||||
|
memcheck(s2, s2_len);
|
||||||
if (tal_count(s1) != tal_count(s2))
|
return memeq(s1, s1_len, s2, s2_len);
|
||||||
return false;
|
|
||||||
if (tal_count(s1) == 0)
|
|
||||||
return true;
|
|
||||||
return memcmp(s1, s2, tal_count(s1)) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue