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

Side by Side Diff: Source/core/dom/DocumentOrderedMap.cpp

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 years, 10 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
« no previous file with comments | « Source/core/dom/DocumentMarkerController.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void DocumentOrderedMap::add(StringImpl* key, Element* element) 64 void DocumentOrderedMap::add(StringImpl* key, Element* element)
65 { 65 {
66 ASSERT(key); 66 ASSERT(key);
67 ASSERT(element); 67 ASSERT(element);
68 68
69 Map::AddResult addResult = m_map.add(key, adoptPtr(new MapEntry(element))); 69 Map::AddResult addResult = m_map.add(key, adoptPtr(new MapEntry(element)));
70 if (addResult.isNewEntry) 70 if (addResult.isNewEntry)
71 return; 71 return;
72 72
73 OwnPtr<MapEntry>& entry = addResult.iterator->value; 73 OwnPtr<MapEntry>& entry = addResult.storedValue->value;
74 ASSERT(entry->count); 74 ASSERT(entry->count);
75 entry->element = 0; 75 entry->element = 0;
76 entry->count++; 76 entry->count++;
77 entry->orderedList.clear(); 77 entry->orderedList.clear();
78 } 78 }
79 79
80 void DocumentOrderedMap::remove(StringImpl* key, Element* element) 80 void DocumentOrderedMap::remove(StringImpl* key, Element* element)
81 { 81 {
82 ASSERT(key); 82 ASSERT(key);
83 ASSERT(element); 83 ASSERT(element);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 { 168 {
169 return get<keyMatchesLowercasedMapName>(key, scope); 169 return get<keyMatchesLowercasedMapName>(key, scope);
170 } 170 }
171 171
172 Element* DocumentOrderedMap::getElementByLabelForAttribute(StringImpl* key, cons t TreeScope* scope) const 172 Element* DocumentOrderedMap::getElementByLabelForAttribute(StringImpl* key, cons t TreeScope* scope) const
173 { 173 {
174 return get<keyMatchesLabelForAttribute>(key, scope); 174 return get<keyMatchesLabelForAttribute>(key, scope);
175 } 175 }
176 176
177 } // namespace WebCore 177 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentMarkerController.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698