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

AddAtom argument constness #2583

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 include/openbabel/mol.h
Expand Up @@ -180,10 +180,10 @@ enum HydrogenType { AllHydrogen, PolarHydrogen, NonPolarHydrogen };
//! \param atom the atom to add
//! \param forceNewId whether to make a new atom Id even if the atom already has one (default is false)
//! \return Whether the method was successful
bool AddAtom(OBAtom& atom, bool forceNewId = false);
bool AddAtom(const OBAtom& atom, bool forceNewId = false);
//! Add a new atom to this molecule (like AddAtom)
//! Calls BeginModify() before insertion and EndModify() after insertion
bool InsertAtom(OBAtom &);
bool InsertAtom(const OBAtom &);
//! Add a new bond to the molecule with the specified parameters
//! \param beginIdx the atom index of the "start" atom
//! \param endIdx the atom index of the "end" atom
Expand Down
4 changes: 2 additions & 2 deletions src/mol.cpp
Expand Up @@ -1714,7 +1714,7 @@ namespace OpenBabel
//! \brief Add an atom to a molecule
//!
//! Also checks bond_queue for any bonds that should be made to the new atom
bool OBMol::AddAtom(OBAtom &atom, bool forceNewId)
bool OBMol::AddAtom(const OBAtom &atom, bool forceNewId)
{
// BeginModify();

Expand Down Expand Up @@ -1787,7 +1787,7 @@ namespace OpenBabel
return(true);
}

bool OBMol::InsertAtom(OBAtom &atom)
bool OBMol::InsertAtom(const OBAtom &atom)
{
BeginModify();
AddAtom(atom);
Expand Down