summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2014-06-19 08:33:46 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2014-06-19 08:33:46 (GMT)
commitf7083045c6f7d23bac47b8302e413becd53fc030 (patch)
tree09b133c46cf164c136ed97cd7c16bf37738dd74f
parent16df17c0481e58c2d2112780df1ed5f80b140ee8 (diff)
When adding a bond do not automatically check if it exists.
Leave that responsibility to the caller to speed things up. Change-Id: Ide4741d0ad7461bf600766cbc49ad3b5e781fd9e
-rw-r--r--src/lib/tng_io.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index fb6089c..252cbb2 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -8515,21 +8515,9 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_bond_add
const int64_t to_atom_id,
tng_bond_t *bond)
{
- int64_t i;
tng_bond_t new_bonds;
(void)tng_data;
- for(i = 0; i < molecule->n_bonds; i++)
- {
- *bond = &molecule->bonds[i];
- /* Check if the bond already exists */
- if(((*bond)->from_atom_id == from_atom_id && (*bond)->to_atom_id == to_atom_id) ||
- ((*bond)->to_atom_id == from_atom_id && (*bond)->from_atom_id == to_atom_id))
- {
- return(TNG_SUCCESS);
- }
- }
-
new_bonds = realloc(molecule->bonds,
sizeof(struct tng_bond) *
(molecule->n_bonds + 1));
contact: Jan Huwald // Impressum