~michihenning/storage-framework/stand-alone-provider-headers

« back to all changes in this revision

Viewing changes to src/provider/internal/DBusPeerCache.cpp

  • Committer: Michi Henning
  • Date: 2016-08-23 23:45:34 UTC
  • mfrom: (53.1.4 devel)
  • Revision ID: michi.henning@canonical.com-20160823234534-4owayhnhcp67g39q
Merged devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    try
75
75
    {
76
76
        Credentials const& credentials = cache_.at(peer);
77
 
        return boost::make_ready_future<Credentials>(credentials);
 
77
        boost::promise<Credentials> p;
 
78
        p.set_value(credentials);
 
79
        return p.get_future();
78
80
    }
79
81
    catch (std::out_of_range const &)
80
82
    {
91
93
        // LCOV_EXCL_START
92
94
        cache_.emplace(peer, std::move(credentials));
93
95
        old_cache_.erase(peer);
94
 
        return boost::make_ready_future<Credentials>(credentials);
 
96
        boost::promise<Credentials> p;
 
97
        p.set_value(credentials);
 
98
        return p.get_future();
95
99
        // LCOV_EXCL_STOP
96
100
    }
97
101
    catch (std::out_of_range const &)