mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 12:21:23 +00:00
Replace deprecated Vector::Length() with Vector::size() (#5131)
- enable FLATBUFFERS_ATTRIBUTE if C++17 or higher
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3f388ec747
commit
fcacb46d01
@@ -94,7 +94,7 @@ std::string MakeCamel(const std::string &in, bool first) {
|
||||
void DeserializeDoc( std::vector<std::string> &doc,
|
||||
const Vector<Offset<String>> *documentation) {
|
||||
if (documentation == nullptr) return;
|
||||
for (uoffset_t index = 0; index < documentation->Length(); index++)
|
||||
for (uoffset_t index = 0; index < documentation->size(); index++)
|
||||
doc.push_back(documentation->Get(index)->str());
|
||||
}
|
||||
|
||||
@@ -2755,8 +2755,8 @@ bool StructDef::Deserialize(Parser &parser, const reflection::Object *object) {
|
||||
predecl = false;
|
||||
sortbysize = attributes.Lookup("original_order") == nullptr && !fixed;
|
||||
std::vector<uoffset_t> indexes =
|
||||
std::vector<uoffset_t>(object->fields()->Length());
|
||||
for (uoffset_t i = 0; i < object->fields()->Length(); i++)
|
||||
std::vector<uoffset_t>(object->fields()->size());
|
||||
for (uoffset_t i = 0; i < object->fields()->size(); i++)
|
||||
indexes[object->fields()->Get(i)->id()] = i;
|
||||
for (size_t i = 0; i < indexes.size(); i++) {
|
||||
auto field = object->fields()->Get(indexes[i]);
|
||||
|
||||
Reference in New Issue
Block a user