Optimizing `TracingAgent::start()`
I believe that the DispatchResponse TracingAgent::start()
function can be improved to be more efficient and more readable for those who wish to contribute.
- Unified the two error checking conditions into one;
- Used the
length()
function to check whether at least one category has been enabled; - Used the set initialization
std::set
to insert elements directly from an array; - Unified the two null checks into one.
I believe that this way, it is easier to interpret what is happening in this snippet code and look for further improvements.