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

Side by Side Diff: third_party/WebKit/Source/platform/json/JSONValues.cpp

Issue 2673543003: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 double JSONObject::doubleProperty(const String& name, 336 double JSONObject::doubleProperty(const String& name,
337 double defaultValue) const { 337 double defaultValue) const {
338 double result = defaultValue; 338 double result = defaultValue;
339 getDouble(name, &result); 339 getDouble(name, &result);
340 return result; 340 return result;
341 } 341 }
342 342
343 void JSONObject::remove(const String& name) { 343 void JSONObject::remove(const String& name) {
344 m_data.remove(name); 344 m_data.erase(name);
345 for (size_t i = 0; i < m_order.size(); ++i) { 345 for (size_t i = 0; i < m_order.size(); ++i) {
346 if (m_order[i] == name) { 346 if (m_order[i] == name) {
347 m_order.remove(i); 347 m_order.remove(i);
348 break; 348 break;
349 } 349 }
350 } 350 }
351 } 351 }
352 352
353 void JSONObject::writeJSON(StringBuilder* output) const { 353 void JSONObject::writeJSON(StringBuilder* output) const {
354 output->append('{'); 354 output->append('{');
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 DCHECK(value); 482 DCHECK(value);
483 m_data.push_back(std::move(value)); 483 m_data.push_back(std::move(value));
484 } 484 }
485 485
486 JSONValue* JSONArray::at(size_t index) { 486 JSONValue* JSONArray::at(size_t index) {
487 DCHECK_LT(index, m_data.size()); 487 DCHECK_LT(index, m_data.size());
488 return m_data[index].get(); 488 return m_data[index].get();
489 } 489 }
490 490
491 } // namespace blink 491 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | third_party/WebKit/Source/platform/network/HTTPHeaderMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698