diff options
author | 2017-06-01 09:42:04 -0700 | |
---|---|---|
committer | 2017-06-01 09:45:21 -0700 | |
commit | eb10a4c494d95e7c17ddc44ef35197d08f2f6b33 (patch) | |
tree | c920e61142ba74b437c3c39036a4748ba575b039 /tensorflow/core/util/command_line_flags_test.cc | |
parent | ce32228c49e595f966485acee947131e4ab04905 (diff) |
Preallocate vector storage when the ultimate vector size is known in advance
PiperOrigin-RevId: 157724431
Diffstat (limited to 'tensorflow/core/util/command_line_flags_test.cc')
-rw-r--r-- | tensorflow/core/util/command_line_flags_test.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/core/util/command_line_flags_test.cc b/tensorflow/core/util/command_line_flags_test.cc index 62025463af..c86a70ec9d 100644 --- a/tensorflow/core/util/command_line_flags_test.cc +++ b/tensorflow/core/util/command_line_flags_test.cc @@ -27,6 +27,7 @@ namespace { std::vector<char *> CharPointerVectorFromStrings( const std::vector<string> &strings) { std::vector<char *> result; + result.reserve(strings.size()); for (const string &string : strings) { result.push_back(const_cast<char *>(string.c_str())); } |