Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Bool for flatbuffers 'bool' instead of Byte in swift #7876

Merged
merged 2 commits into from
Mar 26, 2023

Conversation

blindspotbounty
Copy link
Contributor

This PR is for minor change replacing Byte to Bool in read/mutate methods.

Example:
Before the change:

public var testbool: Bool { let o = _accessor.offset(VTOFFSET.testbool.v); return o == 0 ? false : 0 != _accessor.readBuffer(of: Byte.self, at: o) }

After fix:

public var testbool: Bool { let o = _accessor.offset(VTOFFSET.testbool.v); return o == 0 ? false : _accessor.readBuffer(of: Bool.self, at: o) }

Related to issue #7372

@github-actions github-actions bot added c++ codegen Involving generating code from schema swift labels Mar 23, 2023
mustiikhalil
mustiikhalil previously approved these changes Mar 23, 2023
Copy link
Collaborator

@mustiikhalil mustiikhalil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at these changes they seem to be alright

Add test for Bool type in swift
@blindspotbounty
Copy link
Contributor Author

I've additionally added assert to a mutate test to ensure that nothing is broken. Now removing draft status from this PR.

Copy link
Collaborator

@mustiikhalil mustiikhalil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blindspotbounty blindspotbounty marked this pull request as ready for review March 26, 2023 23:08
@mustiikhalil mustiikhalil merged commit 477b1b5 into google:master Mar 26, 2023
@mustiikhalil
Copy link
Collaborator

@blindspotbounty thanks for your contribution.

jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
Add test for Bool type in swift

Co-authored-by: mustiikhalil <26250654+mustiikhalil@users.noreply.github.com>
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
Add test for Bool type in swift

Co-authored-by: mustiikhalil <26250654+mustiikhalil@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants