Improved Array assignment operator efficiency
Improved Array assignment operator efficiency

In the Array assignment operator, an unnecessary
copy of d->data was being made when d->ref() >= 2
because of the use of the detach() function. This
copy of d->data was almost immediately over-written
in the assignment operator.

Adding a detach() function that does not copy the data
fixes this problem. It is detach_noCopy(). This function
is now called instead of detach() when d->data() is about
to be cleared or overwritten since the extra copy is
unnecessary.

Note: we could also do this by adding a parameter with a
default to detach() (such as detach(bool copy = true)).
However, the detach() is inline anyways, so it probably
produces less machine code with a separate, shorter
inline function.

OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs