use one-liner debug(messages)

This commit is contained in:
Chris Lu
2012-09-27 12:17:27 -07:00
parent 2fd6b65a9e
commit 5cb38f9ea7
5 changed files with 25 additions and 52 deletions

View File

@@ -51,14 +51,10 @@ func runFix(cmd *Command, args []string) bool {
nm := storage.NewNeedleMap(indexFile)
offset := uint32(storage.SuperBlockSize)
for n != nil {
if *IsDebug {
log.Println("key", n.Id, "volume offset", offset, "data_size", n.Size, "length", length)
}
debug("key", n.Id, "volume offset", offset, "data_size", n.Size, "length", length)
if n.Size > 0 {
count, pe := nm.Put(n.Id, offset/8, n.Size)
if *IsDebug {
log.Println("saved", count, "with error", pe)
}
debug("saved", count, "with error", pe)
}
offset += length
n, length = storage.ReadNeedle(dataFile)