OLD | NEW |
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 <list> | 5 #include <list> |
6 #include <map> | 6 #include <map> |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 if (timestamps1.size() != timestamps2.size()) { | 85 if (timestamps1.size() != timestamps2.size()) { |
86 return timestamps1.size() < timestamps2.size(); | 86 return timestamps1.size() < timestamps2.size(); |
87 } | 87 } |
88 | 88 |
89 std::set<base::Time>::iterator it; | 89 std::set<base::Time>::iterator it; |
90 for (it = timestamps1.begin(); it != timestamps1.end(); it++) { | 90 for (it = timestamps1.begin(); it != timestamps1.end(); it++) { |
91 timestamps2.erase(*it); | 91 timestamps2.erase(*it); |
92 } | 92 } |
93 | 93 |
94 return timestamps2.size() != 0U; | 94 return !timestamps2.empty(); |
95 } | 95 } |
96 | 96 |
97 void AutoFillProfile31FromStatement(const sql::Statement& s, | 97 void AutoFillProfile31FromStatement(const sql::Statement& s, |
98 AutoFillProfile* profile, | 98 AutoFillProfile* profile, |
99 string16* label, | 99 string16* label, |
100 int* unique_id, | 100 int* unique_id, |
101 int64* date_modified) { | 101 int64* date_modified) { |
102 DCHECK(profile); | 102 DCHECK(profile); |
103 DCHECK(label); | 103 DCHECK(label); |
104 DCHECK(unique_id); | 104 DCHECK(unique_id); |
(...skipping 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3165 | 3165 |
3166 // Check that the country code is properly converted. | 3166 // Check that the country code is properly converted. |
3167 sql::Statement s(connection.GetUniqueStatement( | 3167 sql::Statement s(connection.GetUniqueStatement( |
3168 "SELECT country_code FROM autofill_profiles")); | 3168 "SELECT country_code FROM autofill_profiles")); |
3169 | 3169 |
3170 ASSERT_TRUE(s.Step()); | 3170 ASSERT_TRUE(s.Step()); |
3171 std::string country_code = s.ColumnString(0); | 3171 std::string country_code = s.ColumnString(0); |
3172 EXPECT_EQ("US", country_code); | 3172 EXPECT_EQ("US", country_code); |
3173 } | 3173 } |
3174 } | 3174 } |
OLD | NEW |