mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
Support binary search for struct in cpp (#4245)
* Support binary search for struct in cpp CreateVectorOfSortedStruct is provided for convenience. * fix continuous-integration error * add generated files * compile Ability.cs in csharp test * compile Ability.cs in csharp * modify according to code review
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
89041a1686
commit
a5cc2092a6
@@ -1291,7 +1291,9 @@ void GenStruct(StructDef &struct_def, std::string *code_ptr) {
|
||||
code += "); }\n";
|
||||
}
|
||||
}
|
||||
if (struct_def.has_key) {
|
||||
// Only generate key compare function for table,
|
||||
// because `key_field` is not set for struct
|
||||
if (struct_def.has_key && !struct_def.fixed) {
|
||||
if (lang_.language == IDLOptions::kJava) {
|
||||
code += "\n @Override\n protected int keysCompare(";
|
||||
code += "Integer o1, Integer o2, ByteBuffer _bb) {";
|
||||
|
||||
Reference in New Issue
Block a user