team-charls / charls

CharLS, a C++ JPEG-LS library implementation
BSD 3-Clause "New" or "Revised" License
180 stars 74 forks source link

Replace functors with function pointers #324

Closed vbaderks closed 3 weeks ago

vbaderks commented 3 weeks ago

The functors were constructed on the heap and the actual implementation was called using a virtual method call. The main advantage of a functor (insert inline) could not be leveraged.

As a first step replace these functors with basic function pointers. It replaces a virtual call to a member function with a function pointer call to a static method (no need to pass this pointer).

sonarcloud[bot] commented 3 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
29.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud