Skip to content

Commit

Permalink
Resolve #59
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Feb 27, 2019
1 parent f456915 commit 0daed8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions processor/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,16 @@ func blankState(
// This is the 'hot' path for the application and needs to be as fast as possible
func CountStats(fileJob *FileJob) {

// Needs to always run to ensure the language is set
determineLanguage(fileJob)

// If the file has a length of 0 it is is empty then we say it has no lines
fileJob.Bytes = int64(len(fileJob.Content))
if fileJob.Bytes == 0 {
fileJob.Lines = 0
return
}

determineLanguage(fileJob)

LanguageFeaturesMutex.Lock()
langFeatures := LanguageFeatures[fileJob.Language]
LanguageFeaturesMutex.Unlock()
Expand Down

0 comments on commit 0daed8e

Please sign in to comment.