From d160c7e565ef3c3429ca601b5a10b13949579b36 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 21 Feb 2016 18:45:24 -0300 Subject: Little refactoring of diff highlight. Moving cache variable to template instead of in the struct. --- models/git_diff.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'models/git_diff.go') diff --git a/models/git_diff.go b/models/git_diff.go index 9796ef59..ab70139f 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -161,7 +161,6 @@ type DiffFile struct { IsBin bool IsRenamed bool Sections []*DiffSection - HighlightClass string } func (diffFile *DiffFile) GetType() int { @@ -169,10 +168,7 @@ func (diffFile *DiffFile) GetType() int { } func (diffFile *DiffFile) GetHighlightClass() string { - if diffFile.HighlightClass == "" { - diffFile.HighlightClass = highlight.FileNameToHighlightClass(diffFile.Name) - } - return diffFile.HighlightClass + return highlight.FileNameToHighlightClass(diffFile.Name) } type Diff struct { -- cgit v1.2.3