File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -63,21 +63,23 @@ public func run_SubstringFromLongStringGeneric(_ n: Int) {
6363 }
6464}
6565
66- @inline ( never)
67- public func run_StringFromLongWholeSubstring( _ n: Int ) {
66+ private func getLongWideRealBuffer( ) -> String {
6867 var s0 = longWide
6968 s0 += " ! " // ensure the string has a real buffer
70- let s = Substring ( s0)
69+ return s0
70+ }
71+
72+ @inline ( never)
73+ public func run_StringFromLongWholeSubstring( _ n: Int ) {
74+ let s = Substring ( getLongWideRealBuffer ( ) )
7175 for _ in 1 ... n*500 {
7276 blackHole ( String ( s) )
7377 }
7478}
7579
7680@inline ( never)
7781public func run_StringFromLongWholeSubstringGeneric( _ n: Int ) {
78- var s0 = longWide
79- s0 += " ! " // ensure the string has a real buffer
80- let s = Substring ( s0)
82+ let s = Substring ( getLongWideRealBuffer ( ) )
8183 for _ in 1 ... n*500 {
8284 create ( String . self, from: s)
8385 }
You can’t perform that action at this time.
0 commit comments