ERGO-Code / HiGHS

Linear optimization software
MIT License
994 stars 185 forks source link

Fix some more compiler warnings #1961

Closed fwesselm closed 1 month ago

fwesselm commented 1 month ago

These changes fix some more compiler warnings reported by Visual Studio.

Testing on 850+ MIPs showed that the changes do not have any effect on HiGHS' behavior.

fwesselm commented 1 month ago

I realize that I made a minor change in HighsTaskExecutor::ExecutorHandle::dispose() along the way. The method does nothing when ptr == nullptr. So, I thought having if (ptr == nullptr) return; would be easier than having an if-block if (ptr != nullptr) {...} that basically includes the entire method code. I can revert this, if it's controversial.

galabovaa commented 1 month ago

OK, the HighsTaskExecutor is more of a style change. There is a style argument to not have extra "return" statements, unless it really cleans up the code. In this case, your change does not affect performance so we are happy to accept to modify it as you have suggested.