countlines in go asm, v1
This commit is contained in:
commit
9384c46598
8 changed files with 250 additions and 0 deletions
14
countlines_go.go
Normal file
14
countlines_go.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package countlines
|
||||
|
||||
//func countNewlinesGo(s []byte) uint64 {
|
||||
//return uint64(bytes.Count(s, []byte{'\n'}))
|
||||
//}
|
||||
|
||||
func countNewlinesGo(s []byte) (out uint64) {
|
||||
for _, x := range s {
|
||||
if x == '\n' {
|
||||
out += 1
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue