Pass constant parameter by reference to load_operations() (#788814)
It is common C++ practice to pass a constant object by reference to avoid constructing a duplicate object for pass by value [1]. [1] How to pass objects to functions in C++? https://stackoverflow.com/questions/2139224/how-to-pass-objects-to-functions-in-c/2139254#2139254 Bug 788814 - gparted-0.30.0/include/HBoxOperations.h:37]: performance problem
This commit is contained in:
parent
56d8533add
commit
97ce96da03
|
@ -34,7 +34,7 @@ public:
|
|||
HBoxOperations() ;
|
||||
~HBoxOperations() ;
|
||||
|
||||
void load_operations( const std::vector<Operation *> operations ) ;
|
||||
void load_operations(const std::vector<Operation *>& operations);
|
||||
void clear() ;
|
||||
|
||||
sigc::signal< void > signal_undo ;
|
||||
|
|
|
@ -68,7 +68,8 @@ HBoxOperations::HBoxOperations()
|
|||
Gtk::Stock::CLOSE, sigc::mem_fun(*this, &HBoxOperations::on_close))));
|
||||
}
|
||||
|
||||
void HBoxOperations::load_operations( const std::vector<Operation *> operations )
|
||||
|
||||
void HBoxOperations::load_operations(const std::vector<Operation *>& operations)
|
||||
{
|
||||
liststore_operations ->clear();
|
||||
|
||||
|
|
Loading…
Reference in New Issue