mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 11:44:12 +00:00
[C++] Fix compiler warning -Wredundant-parens in clang (#6761)
This commit is contained in:
@@ -1932,7 +1932,7 @@ class FlatBufferBuilder {
|
|||||||
/// where the vector is stored.
|
/// where the vector is stored.
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
Offset<Vector<const T *>> CreateVectorOfNativeStructs(
|
Offset<Vector<const T *>> CreateVectorOfNativeStructs(
|
||||||
const S *v, size_t len, T((*const pack_func)(const S &))) {
|
const S *v, size_t len, T (*const pack_func)(const S &)) {
|
||||||
FLATBUFFERS_ASSERT(pack_func);
|
FLATBUFFERS_ASSERT(pack_func);
|
||||||
auto structs = StartVectorOfStructs<T>(len);
|
auto structs = StartVectorOfStructs<T>(len);
|
||||||
for (size_t i = 0; i < len; i++) { structs[i] = pack_func(v[i]); }
|
for (size_t i = 0; i < len; i++) { structs[i] = pack_func(v[i]); }
|
||||||
@@ -2020,7 +2020,7 @@ class FlatBufferBuilder {
|
|||||||
/// where the vector is stored.
|
/// where the vector is stored.
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
Offset<Vector<const T *>> CreateVectorOfNativeStructs(
|
Offset<Vector<const T *>> CreateVectorOfNativeStructs(
|
||||||
const std::vector<S> &v, T((*const pack_func)(const S &))) {
|
const std::vector<S> &v, T (*const pack_func)(const S &)) {
|
||||||
return CreateVectorOfNativeStructs<T, S>(data(v), v.size(), pack_func);
|
return CreateVectorOfNativeStructs<T, S>(data(v), v.size(), pack_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user