Skip to content

Commit 59fd7ba

Browse files
authored
Apply suggestions from code review
[stdlib] operator precedence strikes again
1 parent c7d5008 commit 59fd7ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ extension Unsafe${Mutable}RawBufferPointer {
793793
}
794794

795795
_debugPrecondition(
796-
Int(bitPattern: base) & MemoryLayout<S.Element>.alignment-1 == 0,
796+
Int(bitPattern: base) & (MemoryLayout<S.Element>.alignment-1) == 0,
797797
"buffer base address must be properly aligned to access S.Element"
798798
)
799799

@@ -853,7 +853,7 @@ extension Unsafe${Mutable}RawBufferPointer {
853853
return .init(start: nil, count: 0)
854854
}
855855
_debugPrecondition(
856-
Int(bitPattern: baseAddress) & MemoryLayout<C.Element>.alignment-1 == 0,
856+
Int(bitPattern: baseAddress) & (MemoryLayout<C.Element>.alignment-1) == 0,
857857
"buffer base address must be properly aligned to access C.Element"
858858
)
859859
_precondition(
@@ -878,7 +878,7 @@ extension Unsafe${Mutable}RawBufferPointer {
878878
}
879879
_internalInvariant(_end != nil)
880880
_debugPrecondition(
881-
Int(bitPattern: baseAddress) & MemoryLayout<C.Element>.alignment-1 == 0,
881+
Int(bitPattern: baseAddress) & (MemoryLayout<C.Element>.alignment-1) == 0,
882882
"buffer base address must be properly aligned to access C.Element"
883883
)
884884
var iterator = source.makeIterator()
@@ -940,7 +940,7 @@ extension Unsafe${Mutable}RawBufferPointer {
940940
return .init(start: nil, count: 0)
941941
}
942942
_debugPrecondition(
943-
Int(bitPattern: baseAddress) & MemoryLayout<T>.alignment-1 == 0,
943+
Int(bitPattern: baseAddress) & (MemoryLayout<T>.alignment-1) == 0,
944944
"buffer base address must be properly aligned to access T"
945945
)
946946
_precondition(

0 commit comments

Comments
 (0)