mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-24 08:12:38 +02:00
17 lines
239 B
Go
17 lines
239 B
Go
package main
|
|
|
|
import "C"
|
|
|
|
var cStringsCache = make(map[string]*C.char)
|
|
|
|
func cachedCString(str string) *C.char {
|
|
if cstr, ok := cStringsCache[str]; ok {
|
|
return cstr
|
|
}
|
|
|
|
cstr := C.CString(str)
|
|
cStringsCache[str] = cstr
|
|
|
|
return cstr
|
|
}
|