Commit b986343
authored
Always cast the
Different platforms assign different nullability to the `context`
argument of `bsearch()`'s callback function. For consistency's sake and
to avoid problems porting to future platforms, always cast the value to
an optional before loading from it. The compiler is smart enough to
eliminate the copy/cast, so this is ultimately a zero-cost no-op.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.bsearch() context argument to optional. (#1527)1 parent e20dc82 commit b986343
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
0 commit comments