-
Notifications
You must be signed in to change notification settings - Fork 0
Delete dangling digits throughout the code #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
graag
commented
Oct 29, 2025
- Dodałem delete tam gdzie digit był tworzony a następnie nie jest zapisywany w DigitCollection
- Gdzie się dało zamieniłem na alokowanie zmiennych na stosie
- Przepisałem GateVolumeID tak by używał kompozycji, oryginalnie dziedziczył po std::vector co nie jest dobrą praktyką skoro std::vector nie ma wirtualnego destruktora. Ponieważ był memory leak miałem podejrzenie że może gdzieś ktoś trzyma wskaźnik jako typ *std::vector i to generuje problemy. W efekcie nic się nie zmieniło. Myślę że można założyć że nie jest tu używany polimorfizm, więc się nie upieram żeby zostawić tą zmianę.
|
@wkrzemien Prośba o review :) |
wkrzemien
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ogołnie nie mam większych uwag. Jeżeli chcesz zostawić interfejs vector, to dodałbym przynajmniej implementacje end().
tam gdzie używasz else, to dodaj{} będzie bardziej konsystentnie z istniejącym kodem a mnie Pythonowo. Dałbym też po delete ustawianie nullptr.
|
|
||
| virtual inline ~GateVolumeID() {} | ||
|
|
||
| public: // vector interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To mi się tak średnio podoba. Generalnie pomysł fajny i to co dodałeś też jest ok, tylko że użytkownik mógłby oczekiwać bardziej kompletnego interfejsu, żeby to się zachowywało jako vector. Na pewno brakuje implementacji end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Wydzielę to jako oddzielny PR i dodam ten end.
- Add delete statements for digits that are not stored in geant gigit storage - Convert GateVolumeID from std::vector inheritance to composition
a72f82e to
92c23d6
Compare
|
@wkrzemien Dzięki za review. PR-y do upstream otworzone:
Ten zamykam :) |