Actions
Task #4856
closedUnnecesary conversion to URI in calling isFutureHash
Status:
Closed
Priority:
Low
Assignee:
-
Target version:
-
Start date:
02/25/2019
Due date:
% Done:
0%
Estimated time:
Description
The isFutureHash method takes a Name:
FullProducer::isFutureHash(const ndn::Name& prefix, const std::set<uint32_t>& negative)
When FullProducer::onSyncInterest calls isFutureHash, it converts the Name to a URI string. Then the compiler automatically calls the Name constructor to convert the URI back to a Name.
https://github.com/named-data/PSync/blob/e5fdcc3744d3787949aec0ef23ba9fc8a7db4572/PSync/full-producer.cpp#L198
if (m_prefixes[prefix] != 0 && !isFutureHash(prefix.toUri(), negative)) {
I think you can omit .toUri()
and save some unnecessary conversion.
if (m_prefixes[prefix] != 0 && !isFutureHash(prefix, negative)) {
(This is a low priority observation. Feel free to ignore.)
Updated by Anonymous about 5 years ago
- Subject changed from Unnecesary conversion to URI in calling to Unnecesary conversion to URI in calling isFutureHash
- Status changed from New to Closed
In the updated code with FullProducerArbitrary, the call to isFutureHash is no through the CanAddName callback, which correctly is passed the Name without converting to a URI.
This issue is resolved. Closing.
Actions