mirror of
https://github.com/restic/restic.git
synced 2026-05-14 14:25:23 +00:00
ui/termstatus: reorder findUnchangedLines function
This commit is contained in:
@@ -204,18 +204,6 @@ func (t *Terminal) Run(ctx context.Context) {
|
||||
t.runWithoutStatus(ctx)
|
||||
}
|
||||
|
||||
func findUnchangedLines(curr, last []string) []bool {
|
||||
unchanged := make([]bool, len(curr))
|
||||
|
||||
for i := range min(len(curr), len(last)) {
|
||||
if curr[i] == last[i] {
|
||||
unchanged[i] = true
|
||||
}
|
||||
}
|
||||
|
||||
return unchanged
|
||||
}
|
||||
|
||||
// run listens on the channels and updates the terminal screen.
|
||||
func (t *Terminal) run(ctx context.Context) {
|
||||
var status []string
|
||||
@@ -319,6 +307,18 @@ func (t *Terminal) writeStatus(status []string, skipUnchanged bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func findUnchangedLines(curr, last []string) []bool {
|
||||
unchanged := make([]bool, len(curr))
|
||||
|
||||
for i := range min(len(curr), len(last)) {
|
||||
if curr[i] == last[i] {
|
||||
unchanged[i] = true
|
||||
}
|
||||
}
|
||||
|
||||
return unchanged
|
||||
}
|
||||
|
||||
// runWithoutStatus listens on the channels and just prints out the messages,
|
||||
// without status lines.
|
||||
func (t *Terminal) runWithoutStatus(ctx context.Context) {
|
||||
|
||||
Reference in New Issue
Block a user