Skip to content

Commit

Permalink
removes yolostring (#2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d authored May 14, 2020
1 parent 835dd29 commit e0dacd2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/logproto/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
fmt "fmt"
io "io"
time "time"
"unsafe"
)

// Stream contains a unique labels set as a string and a set of entries for it.
Expand Down Expand Up @@ -148,7 +147,7 @@ func (m *Stream) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Labels = yoloString(dAtA[iNdEx:postIndex])
m.Labels = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
Expand Down Expand Up @@ -301,7 +300,7 @@ func (m *Entry) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Line = yoloString(dAtA[iNdEx:postIndex])
m.Line = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
Expand Down Expand Up @@ -421,7 +420,3 @@ func (m *Entry) Equal(that interface{}) bool {
}
return true
}

func yoloString(buf []byte) string {
return *((*string)(unsafe.Pointer(&buf)))
}

0 comments on commit e0dacd2

Please sign in to comment.