summaryrefslogtreecommitdiffstats
path: root/src/history.go
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2019-07-19 06:22:35 +0200
committerJunegunn Choi <junegunn.c@gmail.com>2019-07-19 13:22:35 +0900
commita1260feeed0cc565dfe3cca9927e1f21af7c80ef (patch)
tree86d3d6b279b5f8a2174cfb55bf895482780cc5a1 /src/history.go
parent7322504ad07297bf44b6a7e2b8ac7a363928e6d7 (diff)
Code cleanup (#1640)
- Replaced time.Now().Sub() with time.Since() - Replaced unnecessary string/byte slice conversions - Removed obsolete return and value assignment in range loop
Diffstat (limited to 'src/history.go')
-rw-r--r--src/history.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/history.go b/src/history.go
index 4aa87fc8..45728d40 100644
--- a/src/history.go
+++ b/src/history.go
@@ -59,7 +59,7 @@ func (h *History) append(line string) error {
lines := append(h.lines[:len(h.lines)-1], line)
if len(lines) > h.maxSize {
- lines = lines[len(lines)-h.maxSize : len(lines)]
+ lines = lines[len(lines)-h.maxSize:]
}
h.lines = append(lines, "")
return ioutil.WriteFile(h.path, []byte(strings.Join(h.lines, "\n")), 0600)