Conversation
|
I don't know why it says that I removed the review request from @dr-orlovsky. Obviously, I want you to review this :) . |
|
There might be some discussion here since dr-orlovsky previously had (perhaps intentionally?) As an extereme, I don't think passing an |
|
To the best of my knowledge, I'd agree with making exception for If you have some resources that indicate something else I'd be happy to learn. |
|
By asking on rust-lang discord I am getting mixed responses. From https://stackoverflow.com/questions/38065331/should-i-borrow-or-copy-my-small-data-types, it also looks like it is opinion-based. All of secp API is full of references for types that are |
|
There is another argument that references is that they are consistent with other APIs. Maybe I will to write a benchmark |
|
My benchmarks say that it does not matter. They are very close in performance and within error of measurement to say if it really matters or not. However semantically, it makes sense to not consume the data because none of the underlying methods require references. I would 100% support this provided we have underlying APIs that require passing by value. What do you think? |
|
Created a new issue to get new input. People might miss this in the taproot PRs |
4002c78 to
347bd11
Compare
|
In the interest of moving things forward (even though I disagree), I have made this pass by value. |
|
Based on your last comment on #708, I don't care whether it's by reference anymore but let's not turn this into refactoring ping-pong. :) |
Kixunil
left a comment
There was a problem hiding this comment.
ACK 347bd117ffa7a2f1ce7b42e35e8a7f06e282f38c
src/util/address.rs
Outdated
There was a problem hiding this comment.
If there's another round of changes, there could be space added before None but please don't bother with it otherwise.
src/util/address.rs
Outdated
There was a problem hiding this comment.
Probably long term - use some kind of lazy static?
src/util/schnorr.rs
Outdated
There was a problem hiding this comment.
If there's another round a newline would be nice.
347bd11 to
e4774e7
Compare
|
Sorry for the delay. Fixed the nits |
dr-orlovsky
left a comment
There was a problem hiding this comment.
utACK e4774e7
Sorry for the delay. Will merge in several minutes
This was my bad for not clearly stating the expected spec #687 . Changed values to references so that we only take ownership where it is required.
This should simplify the #697