apache / datasketches-cpp

Core C++ Sketch Library
https://datasketches.apache.org
Apache License 2.0
225 stars 71 forks source link

avoid needless call to memcpy with an empty entries_ array #301

Closed jmalkin closed 2 years ago

jmalkin commented 2 years ago

Based on #300 , we should avoid calling memcpy() when entries_ is empty to keep -fsanitize=undefiend happy. The sanitizer (reasonably) detected a copy of 0 bytes from nullptr. And while that should be completely harmless in this case, it's cleaner to avoid entirely.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2951678780


Totals Coverage Status
Change from base Build 2885525020: 0.0%
Covered Lines: 2196
Relevant Lines: 2378

💛 - Coveralls
AlexanderSaydakov commented 2 years ago

fixes #300