Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2662423002: Perf test for changing bit masks into switch statements in LayoutObject (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 6a4a5b07426a76c3decd8b6bec230ff82b425a26..a1cee838f2673a2ca7ee80c1b08f573cb678d966 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -2432,24 +2432,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
void setPositionedState(int positionState) {
// This maps FixedPosition and AbsolutePosition to
// IsOutOfFlowPositioned, saving one bit.
- switch (positionState) {
- case StaticPosition:
- m_positionedState = IsStaticallyPositioned;
- break;
- case RelativePosition:
- m_positionedState = IsRelativelyPositioned;
- break;
- case AbsolutePosition:
- case FixedPosition:
- m_positionedState = IsOutOfFlowPositioned;
- break;
- case StickyPosition:
- m_positionedState = IsStickyPositioned;
- break;
- default:
- NOTREACHED();
- break;
- }
+ m_positionedState = static_cast<PositionedState>(positionState & 0x3);
}
void clearPositionedState() { m_positionedState = StaticPosition; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698