-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)Previously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityHandle this with default priorityT: MaintenanceWork to keep up the quality of the code and documentation.Work to keep up the quality of the code and documentation.
Description
As noticed by @diesmann and @mlober, the (*it)->clear() calls in the code below are most likely superfluous, since the vector pointed to by it is deleted immediately afterwards:
nest-simulator/nestkernel/event_delivery_manager.cpp
Lines 119 to 131 in d70928e
| for ( auto it = emitted_spikes_register_.begin(); it < emitted_spikes_register_.end(); ++it ) | |
| { | |
| ( *it )->clear(); | |
| delete ( *it ); | |
| } | |
| emitted_spikes_register_.clear(); | |
| for ( auto it = off_grid_emitted_spikes_register_.begin(); it < off_grid_emitted_spikes_register_.end(); ++it ) | |
| { | |
| ( *it )->clear(); | |
| delete ( *it ); | |
| } | |
| off_grid_emitted_spikes_register_.clear(); |
The loops would also become simpler and more robust using C++11-style container iteration.
Metadata
Metadata
Assignees
Labels
I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)Previously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityHandle this with default priorityT: MaintenanceWork to keep up the quality of the code and documentation.Work to keep up the quality of the code and documentation.
Type
Projects
Status
Done