mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 08:21:36 +00:00
Fixed compile error in LookupByKey fix.
Change-Id: Ice94f09197235cf71b41a22d0767bd7b119284e1
This commit is contained in:
@@ -1241,7 +1241,7 @@ void GenStruct(StructDef &struct_def, std::string *code_ptr) {
|
|||||||
code += "System.Text.Encoding.UTF8.GetBytes(key);\n";
|
code += "System.Text.Encoding.UTF8.GetBytes(key);\n";
|
||||||
code += " int vectorLocation = " + GenByteBufferLength("bb");
|
code += " int vectorLocation = " + GenByteBufferLength("bb");
|
||||||
code += " - vectorOffset";
|
code += " - vectorOffset";
|
||||||
if (lang_.language == IDLOptions::kCsharp) code += ".Value";
|
if (lang_.language == IDLOptions::kCSharp) code += ".Value";
|
||||||
code += ";\n int span = ";
|
code += ";\n int span = ";
|
||||||
code += "bb." + FunctionStart('G') + "etInt(vectorLocation);\n";
|
code += "bb." + FunctionStart('G') + "etInt(vectorLocation);\n";
|
||||||
code += " int start = 0;\n";
|
code += " int start = 0;\n";
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public sealed class Monster : Table {
|
|||||||
|
|
||||||
public static Monster LookupByKey(VectorOffset vectorOffset, string key, ByteBuffer bb) {
|
public static Monster LookupByKey(VectorOffset vectorOffset, string key, ByteBuffer bb) {
|
||||||
byte[] byteKey = System.Text.Encoding.UTF8.GetBytes(key);
|
byte[] byteKey = System.Text.Encoding.UTF8.GetBytes(key);
|
||||||
int vectorLocation = bb.Length - vectorOffset;
|
int vectorLocation = bb.Length - vectorOffset.Value;
|
||||||
int span = bb.GetInt(vectorLocation);
|
int span = bb.GetInt(vectorLocation);
|
||||||
int start = 0;
|
int start = 0;
|
||||||
vectorLocation += 4;
|
vectorLocation += 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user