Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes yolostring #2078

Merged
merged 1 commit into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)))
}