New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't initialize CoordinateSequence in constructor #765
base: main
Are you sure you want to change the base?
Conversation
@dbaston Please take a look, thanks. |
d961c54
to
40be55a
Compare
This ought to improve performance in the common case where initialization is unnecessary. However, the `getDimension` method, in the case where the dimension is unknown (0) looks at the z dimension of the first element in the array to determine if there is z. So we need to initialize at least the first element.
@dbaston, is this a go or a no? |
It makes me nervous despite seeing the tests pass. I would rather creation sites clearly indicate that they do not require initialization by using the constructor that provides this parameter. |
Does such a constructor exist? I'm trying to remember why I found this issue in the first place. I suppose some unit test of mine found it. Maybe performance tanked or something? |
Yes, see geos/include/geos/geom/CoordinateSequence.h Lines 85 to 96 in 4c3bd72
|
Like @dbaston I hate mucking around in the initializers, because the knock-on effects are subtle. I defer to him as usual. |
This ought to improve performance in the common case where initialization is unnecessary.
This fixes #764