mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
more safer (#4186)
push_small(T little_endian_t) => push_small(const T& little_endian_t)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
037314a059
commit
f5120a2aaf
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user