summaryrefslogtreecommitdiffstats
path: root/models/git_diff.go
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2016-02-21 18:45:24 -0300
committerAndrey Nering <andrey.nering@gmail.com>2016-02-21 18:45:24 -0300
commitd160c7e565ef3c3429ca601b5a10b13949579b36 (patch)
treea69cefeb2419ece9f0ee102f2fdf986ce3d6d3ee /models/git_diff.go
parent8ac04a3f291c5cf1a9474c1affeb04a1f94ea5a8 (diff)
downloadgitea-d160c7e565ef3c3429ca601b5a10b13949579b36.tar.gz
gitea-d160c7e565ef3c3429ca601b5a10b13949579b36.zip
Little refactoring of diff highlight.
Moving cache variable to template instead of in the struct.
Diffstat (limited to 'models/git_diff.go')
-rw-r--r--models/git_diff.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/models/git_diff.go b/models/git_diff.go
index 9796ef59f8..ab70139fb3 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 {