Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove unused parameter * Make use of API function to improve redability ```cpp TimePoint TimeCache::getLatestTimestamp() { return storage_.front().stamp_; } ``` And std::list<T>::front() is(gcclib): ```cpp reference front() _GLIBCXX_NOEXCEPT { return *begin(); } ``` * Same argument as 321bd22 ```cpp TimePoint TimeCache::getLatestTimestamp() { // empty list case // ... return storage_.front().stamp_; } ``` and std::list<T>::front(): ```cpp reference front() _GLIBCXX_NOEXCEPT { return *begin(); } ``` * Improve readbility by relying on STL functions By now reading to this block I can tell that we are preventing to inserting a new element in the list, that has a timestamp that is actually older than the max_storage_time_ we allow for * Remove hardcoded algorithmg for STL one The intent of the code is now more clear, instead of relying on raw loops, we "find if" there is any element in the list that has a stamp older than the incoming one. With this we find the position in the list where we should insert the current timestamp: `storage_it` * Remove to better express what this pointer is represetngin * Replace raw loop for STL algorithm Remove if any element is older thant the max_storage_time_ allowed, relative to the latest(sooner) time seems clear npw
- Loading branch information