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

Side by Side Diff: third_party/WebKit/Source/platform/Length.cpp

Issue 2359553003: Replaced PassRefPtr copies with moves. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) 4 * (C) 2001 Dirk Mueller ( mueller@kde.org )
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 int insert(PassRefPtr<CalculationValue> calcValue) 43 int insert(PassRefPtr<CalculationValue> calcValue)
44 { 44 {
45 ASSERT(m_index); 45 ASSERT(m_index);
46 // FIXME calc(): https://bugs.webkit.org/show_bug.cgi?id=80489 46 // FIXME calc(): https://bugs.webkit.org/show_bug.cgi?id=80489
47 // This monotonically increasing handle generation scheme is potentially wasteful 47 // This monotonically increasing handle generation scheme is potentially wasteful
48 // of the handle space. Consider reusing empty handles. 48 // of the handle space. Consider reusing empty handles.
49 while (m_map.contains(m_index)) 49 while (m_map.contains(m_index))
50 m_index++; 50 m_index++;
51 51
52 m_map.set(m_index, calcValue); 52 m_map.set(m_index, std::move(calcValue));
53 53
54 return m_index; 54 return m_index;
55 } 55 }
56 56
57 void remove(int index) 57 void remove(int index)
58 { 58 {
59 ASSERT(m_map.contains(index)); 59 ASSERT(m_map.contains(index));
60 m_map.remove(index); 60 m_map.remove(index);
61 } 61 }
62 62
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return isCalculated() && (&getCalculationValue() == &o.getCalculationValue() || getCalculationValue() == o.getCalculationValue()); 183 return isCalculated() && (&getCalculationValue() == &o.getCalculationValue() || getCalculationValue() == o.getCalculationValue());
184 } 184 }
185 185
186 struct SameSizeAsLength { 186 struct SameSizeAsLength {
187 int32_t value; 187 int32_t value;
188 int32_t metaData; 188 int32_t metaData;
189 }; 189 };
190 static_assert(sizeof(Length) == sizeof(SameSizeAsLength), "length should stay sm all"); 190 static_assert(sizeof(Length) == sizeof(SameSizeAsLength), "length should stay sm all");
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698