aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2019-07-21 06:24:22 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2019-07-29 17:34:49 +0200
commite5c9c0dd9ff1f42dcdaba7a51919cf43abdb79f9 (patch)
treeb6e968170f14360f8ed6bc5820788db847ba93b9 /plumbing/object
parentbfe45eef34bfad73dc9c5255ac8f06ae19501554 (diff)
downloadgo-git-e5c9c0dd9ff1f42dcdaba7a51919cf43abdb79f9.tar.gz
*: avoid unnecessary conversions
No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
Diffstat (limited to 'plumbing/object')
-rw-r--r--plumbing/object/patch.go2
-rw-r--r--plumbing/object/tree.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/object/patch.go b/plumbing/object/patch.go
index 1efd0b1..32454ac 100644
--- a/plumbing/object/patch.go
+++ b/plumbing/object/patch.go
@@ -278,7 +278,7 @@ func printStat(fileStats []FileStat) string {
var scaleFactor float64
if longestTotalChange > heightOfHistogram {
// Scale down to heightOfHistogram.
- scaleFactor = float64(longestTotalChange / heightOfHistogram)
+ scaleFactor = longestTotalChange / heightOfHistogram
} else {
scaleFactor = 1.0
}
diff --git a/plumbing/object/tree.go b/plumbing/object/tree.go
index d30cf6e..d0b4fff 100644
--- a/plumbing/object/tree.go
+++ b/plumbing/object/tree.go
@@ -288,7 +288,7 @@ func (t *Tree) Encode(o plumbing.EncodedObject) (err error) {
return err
}
- if _, err = w.Write([]byte(entry.Hash[:])); err != nil {
+ if _, err = w.Write(entry.Hash[:]); err != nil {
return err
}
}
@@ -517,4 +517,4 @@ func simpleJoin(parent, child string) string {
return parent + "/" + child
}
return child
-} \ No newline at end of file
+}