From 4c6aae20310d3264afbad2fbb70ce3c46b38d191 Mon Sep 17 00:00:00 2001 From: "kling@webkit.org" Date: Sat, 31 Dec 2011 23:39:46 +0000 Subject: [PATCH] CSSStyleSelector: Avoid double hash lookup in keyframeStylesForAnimation(). Reviewed by Anders Carlsson. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::keyframeStylesForAnimation): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103862 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 10 ++++++++++ Source/WebCore/css/CSSStyleSelector.cpp | 7 ++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 57c69a9..cd55bea 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,5 +1,15 @@ 2012-01-01 Andreas Kling + CSSStyleSelector: Avoid double hash lookup in keyframeStylesForAnimation(). + + + Reviewed by Anders Carlsson. + + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::keyframeStylesForAnimation): + +2012-01-01 Andreas Kling + KeyframeAnimation: Use hash lookups to determine if property is animated. diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp index 2b71f09..290d22e 100644 --- a/Source/WebCore/css/CSSStyleSelector.cpp +++ b/Source/WebCore/css/CSSStyleSelector.cpp @@ -2,7 +2,7 @@ * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. * Copyright (C) 2007 Alexey Proskuryakov * Copyright (C) 2007, 2008 Eric Seidel * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) @@ -1388,10 +1388,11 @@ void CSSStyleSelector::keyframeStylesForAnimation(Element* e, const RenderStyle* m_keyframesRuleMap.checkConsistency(); - if (!m_keyframesRuleMap.contains(list.animationName().impl())) + KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(list.animationName().impl()); + if (it == m_keyframesRuleMap.end()) return; - const WebKitCSSKeyframesRule* rule = m_keyframesRuleMap.find(list.animationName().impl()).get()->second.get(); + const WebKitCSSKeyframesRule* rule = it->second.get(); // Construct and populate the style for each keyframe for (unsigned i = 0; i < rule->length(); ++i) { -- 2.7.4