summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index b01656ec9..b1e48c156 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -1032,12 +1032,7 @@ class _MaskedBinaryOperation:
if m is not nomask and m.any():
# any errors, just abort; impossible to guarantee masked values
try:
- np.copyto(result, 0, casting='unsafe', where=m)
- # avoid using "*" since this may be overlaid
- masked_da = umath.multiply(m, da)
- # only add back if it can be cast safely
- if np.can_cast(masked_da.dtype, result.dtype, casting='safe'):
- result += masked_da
+ np.copyto(result, da, casting='unsafe', where=m)
except:
pass