cc: Prevent vector finds that are not needed.

The caller knows if it was in the vector of layers with copy
requests already or not, since it knows if it had copy requests
already or not. So have the LayerImpl only add itself to the
list if it's not in the list.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/21038006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214442 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index c160d97..8d1d048 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -584,10 +584,9 @@
   // they are aborted if not serviced during draw.
   DCHECK(IsActiveTree());
 
-  if (std::find(layers_with_copy_output_request_.begin(),
-                layers_with_copy_output_request_.end(),
-                layer) != layers_with_copy_output_request_.end())
-    return;
+  DCHECK(std::find(layers_with_copy_output_request_.begin(),
+                   layers_with_copy_output_request_.end(),
+                   layer) == layers_with_copy_output_request_.end());
   layers_with_copy_output_request_.push_back(layer);
 }
 
@@ -601,8 +600,7 @@
       layers_with_copy_output_request_.end(),
       layer);
   DCHECK(it != layers_with_copy_output_request_.end());
-  if (it != layers_with_copy_output_request_.end())
-    layers_with_copy_output_request_.erase(it);
+  layers_with_copy_output_request_.erase(it);
 }
 
 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest()