elastic / ml-cpp

Machine learning C++ code
Other
149 stars 62 forks source link

[ML] Fix incorrect auto type #2618

Closed droberts195 closed 7 months ago

droberts195 commented 7 months ago

This is something that was flagged as a compiler warning.

There was a test where an auto variable resolved to an int, but it really should be 64 bit. It's being used to store a time in epoch seconds, so we get away with this type of error in general until 2038. In the exact test where the problem occurred it will never be a problem as the times being used are very small. However, it's not good practice to use a technically incorrect pattern that may get copied to other places where it matters.