Project

General

Profile

Actions

Task #4848

closed

PendingEntryInfoFull::expirationEvent is unused

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

Status:
Rejected
Priority:
Low
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

This is a low-priority observation. In the PendingEntryInfoFull struct, the expirationEvent member is assigned but never used.
https://github.com/named-data/PSync/blob/e5fdcc3744d3787949aec0ef23ba9fc8a7db4572/PSync/full-producer.hpp#L44

struct PendingEntryInfoFull
{
  IBLT iblt;
  ndn::util::scheduler::ScopedEventId expirationEvent;
};

Here is where expirationEvent is assigned but never used:
https://github.com/named-data/PSync/blob/e5fdcc3744d3787949aec0ef23ba9fc8a7db4572/PSync/full-producer.cpp#L210

entry.expirationEvent = m_scheduler.scheduleEvent(interest.getInterestLifetime(),
                      [this, interest] {
                        NDN_LOG_TRACE("Erase Pending Interest " << interest.getNonce());
                        m_pendingEntries.erase(interest.getName());
                      });

Therefore, expirationEvent can be removed. Now, PendingEntryInfoFull only has one member, iblt. So, PendingEntryInfoFull can also be removed, since it is only used by the m_pendingEntries map.
https://github.com/named-data/PSync/blob/e5fdcc3744d3787949aec0ef23ba9fc8a7db4572/PSync/full-producer.hpp#L187

std::map<ndn::Name, PendingEntryInfoFull> m_pendingEntries;

This can be changed to:

std::map<ndn::Name, IBLT> m_pendingEntries;

(It looks like the same argument applies to PendingEntryInfo::expirationEvent .)
https://github.com/named-data/PSync/blob/e5fdcc3744d3787949aec0ef23ba9fc8a7db4572/PSync/partial-producer.hpp#L40

Actions

Also available in: Atom PDF