Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tar: Do not use String(format:) in octal6/11
String(format:) sometimes returns an empty string even if the number being formatted can be represented in an octal string of the requested length. This may be a thread-safety problem and has only been seen when running the tests. swiftlang/swift-corelibs-foundation#5152 This commit changes octal6/11 to use String(value, radix:) and handle padding directly. This has not failed during hundreds of test runs. Benchmarking the old and new implementations of octal6() shows that the new version also is about twice as fast as the old one and makes no allocations, whereas the old version made 7 allocations.
- Loading branch information