Skip to content

Commit 8b10b0a

Browse files
committed
Convert all io_data_t copying to shared_ptr copying.
Copy constructor of io_data_t is removed.
1 parent a9ada13 commit 8b10b0a

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

exec.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static bool io_transmogrify(const io_chain_t &in_chain, io_chain_t &out_chain, s
397397
case IO_BUFFER:
398398
case IO_CLOSE:
399399
{
400-
out.reset(new io_data_t(*in));
400+
out = in;
401401
break;
402402
}
403403

io.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ io_chain_t io_chain_t::duplicate() const
172172
result.reserve(this->size());
173173
for (io_chain_t::const_iterator iter = this->begin(); iter != this->end(); iter++)
174174
{
175-
result.push_back(shared_ptr<io_data_t>(new io_data_t(**iter)));
175+
result.push_back(*iter);
176176
}
177177
return result;
178178
}
@@ -183,7 +183,7 @@ void io_chain_t::duplicate_prepend(const io_chain_t &src)
183183
this->insert(this->begin(), src.size(), shared_ptr<io_data_t>());
184184
for (size_t idx = 0; idx < src.size(); idx++)
185185
{
186-
this->at(idx).reset(new io_data_t(*src.at(idx)));
186+
this->at(idx) = src.at(idx);
187187
}
188188
}
189189

io.h

-11
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,6 @@ class io_data_t
107107
{
108108
}
109109

110-
io_data_t(const io_data_t &rhs) :
111-
out_buffer(rhs.out_buffer),
112-
io_mode(rhs.io_mode),
113-
fd(rhs.fd),
114-
param1(rhs.param1),
115-
param2(rhs.param2),
116-
filename_cstr(rhs.filename_cstr ? strdup(rhs.filename_cstr) : NULL),
117-
is_input(rhs.is_input)
118-
{
119-
}
120-
121110
~io_data_t()
122111
{
123112
free((void *)filename_cstr);

0 commit comments

Comments
 (0)