Skip to content

Commit

Permalink
removeObject Bugfix
Browse files Browse the repository at this point in the history
-Resolves #45

Simulation class:
-updated removeObject function to remove the corresponding event_ptr by accessing it through the getEventIt function instead of the removeEvent function, thereby guaranteeing the correct event_ptr is removed even when it is a nullptr and saving time that was spent searching through the event_ptrs list to find the matching event ptr
  • Loading branch information
MikeHeiber committed Nov 11, 2018
1 parent 1df8071 commit 5522f56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ namespace KMC_Lattice {
// Clear occupancy of site
lattice.clearOccupancy(object_ptr->getCoords());
// Delete the corresponding Event pointer
removeEvent(*object_ptr->getEventIt());
event_ptrs.erase(object_ptr->getEventIt());
// Delete the Object pointer
object_ptrs.erase(it);
}
Expand Down

0 comments on commit 5522f56

Please sign in to comment.