summaryrefslogtreecommitdiffstats
path: root/extensions/browser/extension_icon_image.cc
diff options
context:
space:
mode:
authorananta <ananta@chromium.org>2015-03-30 20:01:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-31 03:02:47 +0000
commitb5ff8d1fc8b72aa40b8936df0775cec7abc6b849 (patch)
treeefc1bae428fcef8b8d5f86ccf531547f185767ba /extensions/browser/extension_icon_image.cc
parent7cec9b9e3fc7ede864e660b5c9b6b172969bd026 (diff)
downloadchromium_src-b5ff8d1fc8b72aa40b8936df0775cec7abc6b849.zip
chromium_src-b5ff8d1fc8b72aa40b8936df0775cec7abc6b849.tar.gz
chromium_src-b5ff8d1fc8b72aa40b8936df0775cec7abc6b849.tar.bz2
Avoid an ImageSkiaRep copy during iteration and fix an analyze warning due to two variables with the same name.
BUG=461958,427616 Review URL: https://codereview.chromium.org/1038053002 Cr-Commit-Position: refs/heads/master@{#322967}
Diffstat (limited to 'extensions/browser/extension_icon_image.cc')
-rw-r--r--extensions/browser/extension_icon_image.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc
index 31ddd61..023879f 100644
--- a/extensions/browser/extension_icon_image.cc
+++ b/extensions/browser/extension_icon_image.cc
@@ -234,9 +234,9 @@ void IconImage::OnImageLoaded(float scale, const gfx::Image& image_in) {
// ImageSkia from the image does not contain a source which breaks requests
// for scaled images.
std::vector<gfx::ImageSkiaRep> reps = image_skia_.image_reps();
- for (const auto rep : reps) {
- if (!ui::IsSupportedScale(rep.scale()))
- image_skia_.RemoveRepresentation(rep.scale());
+ for (const auto& image_rep : reps) {
+ if (!ui::IsSupportedScale(image_rep.scale()))
+ image_skia_.RemoveRepresentation(image_rep.scale());
}
image_skia_.RemoveRepresentation(scale);