Closed stephen-hqxu closed 1 year ago
It is redundant to use a class for something like this:
class Foo { private: Precondition precond; Intermediate interm; Bar result; public: //store precondition Foo(...) { //do something // ... //store this->precond = precondition_data; } //store intermediate states void addData(const Intermediate& middle) { this->interm = middle; } void finalise() { //use precondition and intermediate data to do stuff // ... //store this->result = result_data; } const Bar& get() const noexcept { return this->bar; } };
Which can be generally simplified to:
namespace Foo { Bar doStuff(const Precondition& precond, const Intermediate& interm) { //do something with precondition and intermediate data // ... //finish return result; } }
Remove class design and turn it into non-OOP if the only member function in the class is a getter function to the result, for the following files:
Class refactor and improvement for source code in SuperAlgorithm+Device are done.
SuperAlgorithm+Device
The majority of tasks are done, only left with a few parser libraries, for which I may do it together with #51.
Problem
It is redundant to use a class for something like this:
Which can be generally simplified to:
Task
Remove class design and turn it into non-OOP if the only member function in the class is a getter function to the result, for the following files: