File tree 1 file changed +8
-8
lines changed 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -787,20 +787,20 @@ outer:
787
787
return result
788
788
}
789
789
790
- // fileWasSaved returns true if the FileHandle passed in has been saved.
791
- // It accomplishes this by checking to see if the original and current FileHandles
792
- // are both overlays, and if the current FileHandles is saved while the original FileHandle
793
- // was not saved.
790
+ // fileWasSaved reports whether the FileHandle passed in has been saved. It
791
+ // accomplishes this by checking to see if the original and current FileHandles
792
+ // are both overlays, and if the current FileHandle is saved while the original
793
+ // FileHandle was not saved.
794
794
func fileWasSaved (originalFH , currentFH source.FileHandle ) bool {
795
795
c , ok := currentFH .(* overlay )
796
- if ok {
796
+ if ! ok || c == nil {
797
797
return true
798
798
}
799
- if originalFH == nil {
799
+ o , ok := originalFH .(* overlay )
800
+ if ! ok || o == nil {
800
801
return c .saved
801
802
}
802
- o , ok := originalFH .(* overlay )
803
- return ok && ! o .saved && c .saved
803
+ return ! o .saved && c .saved
804
804
}
805
805
806
806
// shouldInvalidateMetadata reparses a file's package and import declarations to
You can’t perform that action at this time.
0 commit comments