Commit 45129ef4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 24fd4ed9
...@@ -63,29 +63,24 @@ func (d *dumper) DumpData(datai *zodb.StorageRecordInformation) error { ...@@ -63,29 +63,24 @@ func (d *dumper) DumpData(datai *zodb.StorageRecordInformation) error {
xbuf := &d.xbuf xbuf := &d.xbuf
xbuf.Reset() xbuf.Reset()
//entry := "obj " + datai.Oid.String() + " "
xbuf .S("obj ") .V(&datai.Oid) .Cb(' ') xbuf .S("obj ") .V(&datai.Oid) .Cb(' ')
writeData := false writeData := false
switch { switch {
case datai.Data == nil: case datai.Data == nil:
//entry += "delete"
xbuf.S("delete") xbuf.S("delete")
case datai.Tid != datai.DataTid: case datai.Tid != datai.DataTid:
//entry += "from " + datai.DataTid.String()
xbuf .S("from ") .V(&datai.DataTid) xbuf .S("from ") .V(&datai.DataTid)
default: default:
//entry += fmt.Sprintf("%d sha1:%x", len(datai.Data), sha1.Sum(datai.Data))
dataSha1 := sha1.Sum(datai.Data) dataSha1 := sha1.Sum(datai.Data)
xbuf .D(len(datai.Data)) .S(" sha1:") .Xb(dataSha1[:]) xbuf .D(len(datai.Data)) .S(" sha1:") .Xb(dataSha1[:])
writeData = true writeData = true
} }
//entry += "\n"
xbuf .Cb('\n') xbuf .Cb('\n')
// TODO use writev(data, "\n") via net.Buffers (it is already available) // TODO use writev(data, "\n") via net.Buffers (it is already available)
......
...@@ -55,6 +55,7 @@ func (xid Xid) String() string { ...@@ -55,6 +55,7 @@ func (xid Xid) String() string {
// parseHex64 decode 16-character-wide hex-encoded string into uint64 // parseHex64 decode 16-character-wide hex-encoded string into uint64
// XXX -> xfmt ?
func parseHex64(subj, s string) (uint64, error) { func parseHex64(subj, s string) (uint64, error) {
// XXX like scanf("%016x") but scanf implicitly skips spaces without giving control to caller and is slower // XXX like scanf("%016x") but scanf implicitly skips spaces without giving control to caller and is slower
var b[8]byte var b[8]byte
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment