I am working on C++ on Linux.
I need to remove some duplicated code in two functions.
One function is for computing and another one is for logging.
There are some code that are duplicated in logging(), which is much longer than computing().
The duplicated code is distributed in logging() separately, which means that they are not just copy and paste from computing().
I need to figure out the duplicated part line by line, remove them and then replace the necessary results by passing them as parameters from computing() to logging.
Are there some efficient ways to handle this ?