Alternative implementation using unsafe and delegating to strconv.ParseInt Verifies: SYS-REQ-015 [example] MCDC SYS-REQ-015: N/A
(b *testing.B)
| 133 | // Verifies: SYS-REQ-015 [example] |
| 134 | // MCDC SYS-REQ-015: N/A |
| 135 | func BenchmarkParseIntUnsafeSlower(b *testing.B) { |
| 136 | bytes := []byte("123") |
| 137 | for i := 0; i < b.N; i++ { |
| 138 | strconv.ParseInt(*(*string)(unsafe.Pointer(&bytes)), 10, 64) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // Old implementation that did not check for overflows. |
| 143 | // Verifies: SYS-REQ-015 [example] |
nothing calls this directly
no outgoing calls
no test coverage detected