Skip to content

Commit

Permalink
more safer (#4186)
Browse files Browse the repository at this point in the history
push_small(T little_endian_t) => push_small(const T& little_endian_t)
  • Loading branch information
ADHwang authored and aardappel committed Feb 26, 2017
1 parent 037314a commit f5120a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/flatbuffers/flatbuffers.h
Expand Up @@ -565,7 +565,7 @@ class vector_downward {
}

// Specialized version of push() that avoids memcpy call for small data.
template<typename T> void push_small(T little_endian_t) {
template<typename T> void push_small(const T& little_endian_t) {
auto dest = make_space(sizeof(T));
*reinterpret_cast<T *>(dest) = little_endian_t;
}
Expand Down

0 comments on commit f5120a2

Please sign in to comment.