fixes from review

This commit is contained in:
Ethan Buchman
2018-04-27 10:29:05 -04:00
parent f67c5a9e7b
commit c45ba2967a
3 changed files with 11 additions and 5 deletions

View File

@ -267,7 +267,7 @@ func (ps *PartSet) StringShort() string {
func (ps *PartSet) MarshalJSON() ([]byte, error) {
if ps == nil {
return []byte("nil-PartSet"), nil
return []byte("{}"), nil
}
ps.mtx.Lock()
@ -278,6 +278,6 @@ func (ps *PartSet) MarshalJSON() ([]byte, error) {
PartsBitArray *cmn.BitArray `json:"parts_bit_array"`
}{
fmt.Sprintf("%d/%d", ps.Count(), ps.Total()),
ps.partsBitArray.Copy(),
ps.partsBitArray,
})
}