goduf.go
changeset 13 4102e5551e1b
parent 12 15e3580cfb8d
child 14 ea4286b6c4b1
equal deleted inserted replaced
12:15e3580cfb8d 13:4102e5551e1b
    58 // FileObjList is only exported so that we can have a sort interface on inodes.
    58 // FileObjList is only exported so that we can have a sort interface on inodes.
    59 type FileObjList []*fileObj
    59 type FileObjList []*fileObj
    60 
    60 
    61 type sizeClass struct { // XXX still useful?
    61 type sizeClass struct { // XXX still useful?
    62 	files    FileObjList
    62 	files    FileObjList
    63 	medsums  map[string]FileObjList
       
    64 	fullsums map[string]FileObjList
       
    65 }
    63 }
    66 
    64 
    67 type dataT struct {
    65 type dataT struct {
    68 	totalSize   uint64
    66 	totalSize   uint64
    69 	cmpt        uint
    67 	cmpt        uint
   231 	if c1b > 0 {
   229 	if c1b > 0 {
   232 		s1 = fmt.Sprintf("+%d", c1b)
   230 		s1 = fmt.Sprintf("+%d", c1b)
   233 	}
   231 	}
   234 	myLog.Printf(4, "  Current countdown: %d  [%d%s/%d]\n",
   232 	myLog.Printf(4, "  Current countdown: %d  [%d%s/%d]\n",
   235 		c1+c1b, c1, s1, c2)
   233 		c1+c1b, c1, s1, c2)
   236 }
       
   237 
       
   238 func (data *dataT) filesWithSameHash() (hgroups []FileObjList) {
       
   239 	for _, sizeGroup := range data.sizeGroups {
       
   240 		for _, l := range sizeGroup.fullsums {
       
   241 			hgroups = append(hgroups, l)
       
   242 		}
       
   243 	}
       
   244 	return
       
   245 }
   234 }
   246 
   235 
   247 // checksum returns the requested checksum as a string.
   236 // checksum returns the requested checksum as a string.
   248 // If the checksum has not been pre-computed, it is calculated now.
   237 // If the checksum has not been pre-computed, it is calculated now.
   249 func (fo fileObj) checksum(sType sumType) (string, error) {
   238 func (fo fileObj) checksum(sType sumType) (string, error) {