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

Side by Side Diff: base/environment.cc

Issue 1479473002: base: Use std::move() instead of Pass() for real movable types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: basepass: missing-include Created 5 years 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 | « base/containers/scoped_ptr_map_unittest.cc ('k') | base/environment_unittest.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/environment.h" 5 #include "base/environment.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 char* storage_data = reinterpret_cast<char*>( 221 char* storage_data = reinterpret_cast<char*>(
222 &result.get()[result_indices.size() + 1]); 222 &result.get()[result_indices.size() + 1]);
223 if (!value_storage.empty()) 223 if (!value_storage.empty())
224 memcpy(storage_data, value_storage.data(), value_storage.size()); 224 memcpy(storage_data, value_storage.data(), value_storage.size());
225 225
226 // Fill array of pointers at the beginning of the result. 226 // Fill array of pointers at the beginning of the result.
227 for (size_t i = 0; i < result_indices.size(); i++) 227 for (size_t i = 0; i < result_indices.size(); i++)
228 result[i] = &storage_data[result_indices[i]]; 228 result[i] = &storage_data[result_indices[i]];
229 result[result_indices.size()] = 0; // Null terminator. 229 result[result_indices.size()] = 0; // Null terminator.
230 230
231 return result.Pass(); 231 return result;
232 } 232 }
233 233
234 #endif // OS_POSIX 234 #endif // OS_POSIX
235 235
236 } // namespace base 236 } // namespace base
OLDNEW
« no previous file with comments | « base/containers/scoped_ptr_map_unittest.cc ('k') | base/environment_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698