Closed ChristianTackeGSI closed 3 months ago
fairroot/eventdisplay/xml/FairXMLPdgColor.h (2)
`31-31`: **Enhance const-correctness in the constructor parameter.** The constructor parameter type has been changed from `FairXMLNode*` to `const FairXMLNode*`, which enhances const-correctness by ensuring that the input node cannot be modified. This is a good practice for improving code safety and maintainability. --- `33-33`: **New method `SetColorsFromXML` added.** The new method `SetColorsFromXML` is added to the class. This method encapsulates the functionality of setting colors from an XML node, improving modularity and adhering to the single responsibility principle.fairroot/eventdisplay/xml/FairXMLPdgColor.cxx (3)
`23-23`: **Enhance const-correctness in the constructor parameter.** The constructor parameter type has been changed from `FairXMLNode*` to `const FairXMLNode*`, which enhances const-correctness by ensuring that the input node cannot be modified. This is a good practice for improving code safety and maintainability. --- `35-35`: **Refactor: Use the new `SetColorsFromXML` method.** The constructor now calls the new `SetColorsFromXML` method, which encapsulates the logic for setting colors from an XML node. This refactor improves code modularity and adheres to the single responsibility principle. --- Line range hint `38-45`: **New method `SetColorsFromXML` added.** The new method `SetColorsFromXML` is added to encapsulate the functionality of setting colors from an XML node. This improves code modularity and maintainability. The method ensures const-correctness by taking a `const FairXMLNode&` as a parameter.
@DanielWielanek, what do you think about this?
Might this be useful for your other stuff?
Currently only used in the ctor. Exposed for possible other users.
Also added a bit of const.
Checklist: