2
0

Use binary transcoding for inet/cidr

fixes #87
This commit is contained in:
Jack Christensen
2015-09-03 11:39:32 -05:00
parent 9af068add0
commit fd39261551
6 changed files with 85 additions and 50 deletions
+5 -5
View File
@@ -50,11 +50,11 @@ func fpInt64Arg(n int64) fpArg {
}
func (f *fastpath) Call(oid Oid, args []fpArg) (res []byte, err error) {
wbuf := newWriteBuf(f.cn.wbuf[:0], 'F') // function call
wbuf.WriteInt32(int32(oid)) // function object id
wbuf.WriteInt16(1) // # of argument format codes
wbuf.WriteInt16(1) // format code: binary
wbuf.WriteInt16(int16(len(args))) // # of arguments
wbuf := newWriteBuf(f.cn, 'F') // function call
wbuf.WriteInt32(int32(oid)) // function object id
wbuf.WriteInt16(1) // # of argument format codes
wbuf.WriteInt16(1) // format code: binary
wbuf.WriteInt16(int16(len(args))) // # of arguments
for _, arg := range args {
wbuf.WriteInt32(int32(len(arg))) // length of argument
wbuf.WriteBytes(arg) // argument value