diff --git a/zipline/pipeline/engine.py b/zipline/pipeline/engine.py
index <HASH>..<HASH> 100644
--- a/zipline/pipeline/engine.py
+++ b/zipline/pipeline/engine.py
@@ -577,10 +577,9 @@ class SimplePipelineEngine(PipelineEngine):
             for input_ in specialized:
                 input_data = ensure_ndarray(workspace[input_])
                 offset = offsets[term, input_]
-                # OPTIMIZATION: Don't make a copy by doing input_data[0:] if
-                # offset is zero.
-                if offset:
-                    input_data = input_data[offset:]
+                input_data = input_data[offset:]
+                if refcounts[input_] > 1:
+                    input_data = input_data.copy()
                 out.append(input_data)
         return out
BUG: window_length=0 term inputs were not being copied.

Some terms mutate their inputs, but by not copying the data before passing them
to a term, the input could be corrupted and then used in other terms that didn't
expect the mutated input.

This change uses the same reference counting mechanism to only copy when needed
that is applied to windowed terms.