summaryrefslogtreecommitdiff
path: root/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-11 02:25:41 -0800
committerGitHub <noreply@github.com>2019-01-11 02:25:41 -0800
commit26f2b7debde313af4a5ae39727c66a3f8fd59be4 (patch)
tree1ab2968feabc60768ac04c7f832ddfb93f97e3ad /vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
parent36d96c19f947aeac2675afe64a3b482e54f9e4c4 (diff)
parent3966d3bf4e6be2975c330af64ce6ba86b4eeabe0 (diff)
downloadpodman-26f2b7debde313af4a5ae39727c66a3f8fd59be4.tar.gz
podman-26f2b7debde313af4a5ae39727c66a3f8fd59be4.tar.bz2
podman-26f2b7debde313af4a5ae39727c66a3f8fd59be4.zip
Merge pull request #2105 from mheon/jsoniter
Use jsoniter instead of easyjson
Diffstat (limited to 'vendor/github.com/mailru/easyjson/jlexer/bytestostr.go')
-rw-r--r--vendor/github.com/mailru/easyjson/jlexer/bytestostr.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
deleted file mode 100644
index ff7b27c5b..000000000
--- a/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// This file will only be included to the build if neither
-// easyjson_nounsafe nor appengine build tag is set. See README notes
-// for more details.
-
-//+build !easyjson_nounsafe
-//+build !appengine
-
-package jlexer
-
-import (
- "reflect"
- "unsafe"
-)
-
-// bytesToStr creates a string pointing at the slice to avoid copying.
-//
-// Warning: the string returned by the function should be used with care, as the whole input data
-// chunk may be either blocked from being freed by GC because of a single string or the buffer.Data
-// may be garbage-collected even when the string exists.
-func bytesToStr(data []byte) string {
- h := (*reflect.SliceHeader)(unsafe.Pointer(&data))
- shdr := reflect.StringHeader{Data: h.Data, Len: h.Len}
- return *(*string)(unsafe.Pointer(&shdr))
-}