Skip to content

Commit 52fbfcc

Browse files
committed
Small tweak to getting the module hash in RubberduchParserState
1 parent 9ecf58b commit 52fbfcc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,10 @@ private int GetModuleContentHash(QualifiedModuleName module)
900900
{
901901
using (var codeModule = ProjectsProvider.Component(module).CodeModule)
902902
{
903-
return codeModule != null && codeModule.CountOfLines > 0
904-
? codeModule.GetLines(1, codeModule.CountOfLines).GetHashCode()
905-
: 0;
903+
var code = codeModule?.Content();
904+
return string.IsNullOrEmpty(code)
905+
? 0
906+
: code.GetHashCode();
906907
}
907908
}
908909

0 commit comments

Comments
 (0)