Project

General

Profile

Actions

Task #4856

closed

Unnecesary conversion to URI in calling isFutureHash

Added by Anonymous about 5 years ago. Updated about 5 years ago.

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.)

Actions

Also available in: Atom PDF