more safer (#4186)

push_small(T little_endian_t) => push_small(const T& little_endian_t)
This commit is contained in:
Kameiha
2017-02-26 13:24:43 +08:00
committed by Wouter van Oortmerssen
parent 037314a059
commit f5120a2aaf

View File

@@ -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;
}