Skip to content

Commit 46da45c

Browse files
committed
changed push_back to emplace_back
1 parent 9593654 commit 46da45c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

google/cloud/storage/internal/async/multi_stream_manager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ class MultiStreamManager {
7272
// Constructor creates the first stream using the factory immediately.
7373
explicit MultiStreamManager(StreamFactory stream_factory)
7474
: stream_factory_(std::move(stream_factory)) {
75-
streams_.push_back(Stream{stream_factory_(), {}});
75+
streams_.emplace_back(Stream{stream_factory_(), {}});
7676
}
7777

7878
// Constructor accepts an already-created initial stream.
7979
// This is required by ObjectDescriptorImpl which receives an OpenStream.
8080
MultiStreamManager(StreamFactory stream_factory,
8181
std::shared_ptr<StreamT> initial_stream)
8282
: stream_factory_(std::move(stream_factory)) {
83-
streams_.push_back(Stream{std::move(initial_stream), {}});
83+
streams_.emplace_back(Stream{std::move(initial_stream), {}});
8484
}
8585

8686
StreamIterator GetFirstStream() {
@@ -110,7 +110,7 @@ class MultiStreamManager {
110110
}
111111

112112
StreamIterator AddStream(std::shared_ptr<StreamT> stream) {
113-
streams_.push_front(Stream{std::move(stream), {}});
113+
streams_.emplace_front(Stream{std::move(stream), {}});
114114
return streams_.begin();
115115
}
116116

@@ -159,7 +159,7 @@ class MultiStreamManager {
159159
}
160160

161161
bool Empty() const { return streams_.empty(); }
162-
StreamIterator End() { return streams_.end(); }
162+
StreamIterator End() const { return streams_.end(); }
163163
std::size_t Size() const { return streams_.size(); }
164164

165165
private:

0 commit comments

Comments
 (0)