bulk code format fix (#8707)

This commit is contained in:
Derek Bailey
2025-09-23 21:50:27 -07:00
committed by GitHub
parent 0e047869da
commit caf3b494db
559 changed files with 38871 additions and 31276 deletions

View File

@@ -44,7 +44,6 @@ public struct Verifier {
storage.tableCount
}
/// Initializer for the verifier
/// - Parameters:
/// - buffer: Bytebuffer that is required to be verified
@@ -54,8 +53,8 @@ public struct Verifier {
public init(
buffer: inout ByteBuffer,
options: VerifierOptions = .init(),
checkAlignment: Bool = true) throws
{
checkAlignment: Bool = true
) throws {
guard buffer.capacity < FlatBufferMaxSize else {
throw FlatbuffersErrors.exceedsMaxSizeAllowed
}
@@ -186,17 +185,21 @@ public struct Verifier {
let reportedOverflow: (partialValue: UInt32, overflow: Bool)
if offset > 0 {
reportedOverflow = _int32Position
reportedOverflow =
_int32Position
.subtractingReportingOverflow(offset.magnitude)
} else {
reportedOverflow = _int32Position
reportedOverflow =
_int32Position
.addingReportingOverflow(offset.magnitude)
}
/// since `subtractingReportingOverflow` & `addingReportingOverflow` returns true,
/// if there is overflow we return failure
if reportedOverflow.overflow || reportedOverflow.partialValue > _buffer
.capacity
if reportedOverflow.overflow
|| reportedOverflow.partialValue
> _buffer
.capacity
{
throw FlatbuffersErrors.signedOffsetOutOfBounds(
offset: Int(offset),