Skip to content

Commit aeccbd3

Browse files
authored
Merge pull request #205 from EXP-code/copilot/sub-pr-199
Fix thread-unsafe lazy initialization in ExpDeproj::mass()
2 parents ac4b810 + b774886 commit aeccbd3

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

exputil/ExpDeproj.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ double ExpDeproj::density(double R)
4848

4949
double ExpDeproj::mass(double R)
5050
{
51-
// Initialize precomputed arrays?
52-
if (mv.size() == 0) {
53-
initialize();
54-
}
55-
5651
if (R < 0) {
5752
throw std::invalid_argument("R must be non-negative");
5853
}

include/ExpDeproj.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ExpDeproj
1515

1616
public:
1717
//! Constructor
18-
ExpDeproj(int n=4000) : ngrid(n) {}
18+
ExpDeproj(int n=4000) : ngrid(n) { initialize(); }
1919

2020
//! Destructor
2121
virtual ~ExpDeproj() {}

0 commit comments

Comments
 (0)