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

Side by Side Diff: third_party/WebKit/Source/core/dom/SpaceSplitString.cpp

Issue 2776203002: Migrate WTF::Vector::remove() to ::erase() (Closed)
Patch Set: rebase, repatch VectorTest Created 3 years, 8 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) 2007 David Smith (catfish.man@gmail.com) 2 * Copyright (C) 2007 David Smith (catfish.man@gmail.com)
3 * Copyright (C) 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2011, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 void SpaceSplitString::Data::add(const AtomicString& string) { 101 void SpaceSplitString::Data::add(const AtomicString& string) {
102 DCHECK(hasOneRef()); 102 DCHECK(hasOneRef());
103 DCHECK(!contains(string)); 103 DCHECK(!contains(string));
104 m_vector.push_back(string); 104 m_vector.push_back(string);
105 } 105 }
106 106
107 void SpaceSplitString::Data::remove(unsigned index) { 107 void SpaceSplitString::Data::remove(unsigned index) {
108 DCHECK(hasOneRef()); 108 DCHECK(hasOneRef());
109 m_vector.remove(index); 109 m_vector.erase(index);
110 } 110 }
111 111
112 void SpaceSplitString::add(const AtomicString& string) { 112 void SpaceSplitString::add(const AtomicString& string) {
113 // FIXME: add() does not allow duplicates but createVector() does. 113 // FIXME: add() does not allow duplicates but createVector() does.
114 if (contains(string)) 114 if (contains(string))
115 return; 115 return;
116 ensureUnique(); 116 ensureUnique();
117 if (m_data) 117 if (m_data)
118 m_data->add(string); 118 m_data->add(string);
119 } 119 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 createVector(string); 183 createVector(string);
184 } 184 }
185 185
186 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other) 186 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other)
187 : RefCounted<Data>(), m_vector(other.m_vector) { 187 : RefCounted<Data>(), m_vector(other.m_vector) {
188 // Note that we don't copy m_keyString to indicate to the destructor that 188 // Note that we don't copy m_keyString to indicate to the destructor that
189 // there's nothing to be removed from the sharedDataMap(). 189 // there's nothing to be removed from the sharedDataMap().
190 } 190 }
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.h ('k') | third_party/WebKit/Source/core/dom/URLSearchParams.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698