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

Side by Side Diff: chrome/browser/content_settings/content_settings_origin_identifier_value_map.cc

Issue 8273023: Remove an unnecessary comparison in OriginIdentifierValueMap::EntryMapKey::operator< (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/content_settings/content_settings_origin_identifier_val ue_map.h" 5 #include "chrome/browser/content_settings/content_settings_origin_identifier_val ue_map.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/content_settings/content_settings_rule.h" 10 #include "chrome/browser/content_settings/content_settings_rule.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 ContentSettingsType content_type, 53 ContentSettingsType content_type,
54 ResourceIdentifier resource_identifier) 54 ResourceIdentifier resource_identifier)
55 : content_type(content_type), 55 : content_type(content_type),
56 resource_identifier(resource_identifier) { 56 resource_identifier(resource_identifier) {
57 } 57 }
58 58
59 bool OriginIdentifierValueMap::EntryMapKey::operator<( 59 bool OriginIdentifierValueMap::EntryMapKey::operator<(
60 const OriginIdentifierValueMap::EntryMapKey& other) const { 60 const OriginIdentifierValueMap::EntryMapKey& other) const {
61 if (content_type < other.content_type) 61 if (content_type < other.content_type)
62 return true; 62 return true;
63 else if (other.content_type > content_type)
jochen (gone - plz use gerrit) 2011/10/13 23:20:46 I think that should be content_type > other.conten
64 return false;
65 return (resource_identifier < other.resource_identifier); 63 return (resource_identifier < other.resource_identifier);
66 } 64 }
67 65
68 OriginIdentifierValueMap::PatternPair::PatternPair( 66 OriginIdentifierValueMap::PatternPair::PatternPair(
69 ContentSettingsPattern primary_pattern, 67 ContentSettingsPattern primary_pattern,
70 ContentSettingsPattern secondary_pattern) 68 ContentSettingsPattern secondary_pattern)
71 : primary_pattern(primary_pattern), 69 : primary_pattern(primary_pattern),
72 secondary_pattern(secondary_pattern) { 70 secondary_pattern(secondary_pattern) {
73 } 71 }
74 72
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 OriginIdentifierValueMap::EntryMap::iterator OriginIdentifierValueMap::erase( 162 OriginIdentifierValueMap::EntryMap::iterator OriginIdentifierValueMap::erase(
165 OriginIdentifierValueMap::EntryMap::iterator entry) { 163 OriginIdentifierValueMap::EntryMap::iterator entry) {
166 // Erasing from the map doesn't invalidate other iterators than the erased 164 // Erasing from the map doesn't invalidate other iterators than the erased
167 // one. 165 // one.
168 OriginIdentifierValueMap::EntryMap::iterator to_erase = entry++; 166 OriginIdentifierValueMap::EntryMap::iterator to_erase = entry++;
169 entries_.erase(to_erase); 167 entries_.erase(to_erase);
170 return entry; 168 return entry;
171 } 169 }
172 170
173 } // namespace content_settings 171 } // namespace content_settings
OLDNEW
« 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