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

.

parent 24fd4ed9
......@@ -63,29 +63,24 @@ func (d *dumper) DumpData(datai *zodb.StorageRecordInformation) error {
xbuf := &d.xbuf
xbuf.Reset()
//entry := "obj " + datai.Oid.String() + " "
xbuf .S("obj ") .V(&datai.Oid) .Cb(' ')
writeData := false
switch {
case datai.Data == nil:
//entry += "delete"
xbuf.S("delete")
case datai.Tid != datai.DataTid:
//entry += "from " + datai.DataTid.String()
xbuf .S("from ") .V(&datai.DataTid)
default:
//entry += fmt.Sprintf("%d sha1:%x", len(datai.Data), sha1.Sum(datai.Data))
dataSha1 := sha1.Sum(datai.Data)
xbuf .D(len(datai.Data)) .S(" sha1:") .Xb(dataSha1[:])
writeData = true
}
//entry += "\n"
xbuf .Cb('\n')
// TODO use writev(data, "\n") via net.Buffers (it is already available)
......
......@@ -55,6 +55,7 @@ func (xid Xid) String() string {
// parseHex64 decode 16-character-wide hex-encoded string into uint64
// XXX -> xfmt ?
func parseHex64(subj, s string) (uint64, error) {
// XXX like scanf("%016x") but scanf implicitly skips spaces without giving control to caller and is slower
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