Skip to content

test: Replace hashlib.new with named constructor - #23723

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
maflcko:2112-testNoNew
Dec 9, 2021
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
maflcko:2112-testNoNew

Conversation

@maflcko

@maflcko maflcko commented Dec 9, 2021

Copy link
Copy Markdown
Member

A small refactor that doesn't matter too much, but it using the named constructor is nice because:

  • It clarifies that it is a built-in function
  • It is (trivially) faster and less code.

@maflcko

maflcko commented Dec 9, 2021

Copy link
Copy Markdown
Member Author

This removes the last use of new: git grep 'hashlib.new'.

@fanquake fanquake added the Tests label Dec 9, 2021

@Zero-1729 Zero-1729 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa1b63c

Verified no other instance of hashlib.new after this patch.

@w0xlt w0xlt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa1b63c

@maflcko
maflcko merged commit 09e60df into bitcoin:master Dec 9, 2021
RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
…structor

ae2c424 test: Replace hashlib.new with named constructor (MarcoFalke)

Pull request description:

  A small refactor that doesn't matter too much, but it using the named constructor is nice because:
  * It clarifies that it is a built-in function
  * It is (trivially) faster and less code.

ACKs for top commit:
  Zero-1729:
    ACK ae2c424
  w0xlt:
    ACK ae2c424

Tree-SHA512: d23dc4552c1e6fc1f90f8272e47e4efcbe727f0b66a6f6a264db8a50ee6cb6d57a2809befcb95fda6725136672268633817a03dd1859f2298d20e3f9e0ca4a7f
@bitcoin bitcoin locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants