commit e1c78d21ea332398bf8ca2542863408ecaf6b274
parent 12cab67ebce065cd93f622fa3776b291d9b884e8
Author: cfillion <cfillion@users.noreply.github.com>
Date: Mon, 22 Aug 2016 03:03:51 -0400
refactoring – make less copies of shared_ptr<Index>
Diffstat:
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/browser.cpp b/src/browser.cpp
@@ -561,7 +561,7 @@ void Browser::populate()
// thus causing the wrong package to be selected!
m_visibleEntries.clear();
- for(IndexPtr index : m_indexes) {
+ for(const IndexPtr &index : m_indexes) {
for(const Package *pkg : index->packages())
m_entries.push_back(makeEntry(pkg, reg.getEntry(pkg)));
diff --git a/src/reapack.cpp b/src/reapack.cpp
@@ -244,7 +244,7 @@ void ReaPack::about(const Remote &remote, HWND parent)
if(!remote)
return;
- fetchIndex(remote, [=] (IndexPtr index) {
+ fetchIndex(remote, [=] (const IndexPtr &index) {
// do nothing if the index could not be loaded
if(!index)
return;
diff --git a/src/reapack.hpp b/src/reapack.hpp
@@ -43,7 +43,7 @@ typedef std::shared_ptr<const Index> IndexPtr;
class ReaPack {
public:
typedef std::function<void ()> ActionCallback;
- typedef std::function<void (IndexPtr)> IndexCallback;
+ typedef std::function<void (const IndexPtr &)> IndexCallback;
typedef std::function<void (const std::vector<IndexPtr> &)> IndexesCallback;
static const char *VERSION;