summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorblindspotbounty <127803250+blindspotbounty@users.noreply.github.com>2023-03-26 19:45:48 -0400
committerGitHub <noreply@github.com>2023-03-27 01:45:48 +0200
commit477b1b5d1349a2f869e401bee61f50200ccf4c70 (patch)
tree0124bb87013c7feef3638bd385adf48a0efef238 /src
parent1cb1c4baeeedfe3bc90d8c4110c889dd17af5ca7 (diff)
downloadflatbuffers-477b1b5d1349a2f869e401bee61f50200ccf4c70.tar.gz
flatbuffers-477b1b5d1349a2f869e401bee61f50200ccf4c70.tar.bz2
flatbuffers-477b1b5d1349a2f869e401bee61f50200ccf4c70.zip
use Bool for flatbuffers bool instead of Byte (#7876)
Add test for Bool type in swift Co-authored-by: mustiikhalil <26250654+mustiikhalil@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/idl_gen_swift.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/idl_gen_swift.cpp b/src/idl_gen_swift.cpp
index 6afa069e..8257c0c1 100644
--- a/src/idl_gen_swift.cpp
+++ b/src/idl_gen_swift.cpp
@@ -725,9 +725,9 @@ class SwiftGenerator : public BaseGenerator {
code_.SetValue("CONSTANT", default_value);
code_.SetValue("VALUETYPE", "Bool");
code_ += GenReaderMainBody(optional) + "\\";
- code_.SetValue("VALUETYPE", "Byte");
- code_ += GenOffset() + "return o == 0 ? {{CONSTANT}} : 0 != " +
- GenReader("VALUETYPE", "o") + " }";
+ code_ += GenOffset() +
+ "return o == 0 ? {{CONSTANT}} : " + GenReader("VALUETYPE", "o") +
+ " }";
if (parser_.opts.mutable_buffer) code_ += GenMutate("o", GenOffset());
return;
}