From 2a60bf7c1ed0396045125e279c6f40dca5d40ba6 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sat, 20 Mar 2021 21:02:55 +0100 Subject: Fixed stack overflow, still slow... --- glass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glass.cpp b/glass.cpp index 7623765..e8739d0 100644 --- a/glass.cpp +++ b/glass.cpp @@ -139,7 +139,7 @@ template class System { if (overlaps(p).empty()) { typename std::unordered_map>::iterator it; std::tie(it, std::ignore) = particles.insert({r.uniform((unsigned)0, (unsigned)pow(2, 28)), p}); - p.position.occupant = std::prev(particles.end()); + p.position.occupant = it; return true; } else { return false; -- cgit v1.2.3-54-g00ecf