Skip to content
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

cc: fix returning type of sel_types #3181

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/api_cc/include/DataModifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DipoleChargeModifierBase {
* @brief Get the list of sel types.
* @return The list of sel types.
*/
virtual std::vector<int> sel_types() const = 0;
virtual const std::vector<int>& sel_types() const = 0;
};

/**
Expand Down Expand Up @@ -161,7 +161,7 @@ class DipoleChargeModifier {
* @brief Get the list of sel types.
* @return The list of sel types.
*/
std::vector<int> sel_types() const;
const std::vector<int>& sel_types() const;

private:
bool inited;
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/include/DataModifierTF.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DipoleChargeModifierTF : public DipoleChargeModifierBase {
* @brief Get the list of sel types.
* @return The list of sel types.
*/
std::vector<int> sel_types() const {
const std::vector<int>& sel_types() const {
assert(inited);
return sel_type;
};
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/src/DataModifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ double DipoleChargeModifier::cutoff() const { return dcm->cutoff(); }

int DipoleChargeModifier::numb_types() const { return dcm->numb_types(); }

std::vector<int> DipoleChargeModifier::sel_types() const {
const std::vector<int>& DipoleChargeModifier::sel_types() const {
return dcm->sel_types();
}