Simplified boolean comparisons
Just a bit easier to read, in my opinion.
This commit is contained in:
parent
09296c0214
commit
04d4881512
@ -42,10 +42,7 @@ func (ci *Evaluator) LoadConfig(configFile string) error {
|
||||
|
||||
func (ci *Evaluator) isRuleEnabled(rule Rule) bool {
|
||||
value := ci.Config.GetString(rule.Key())
|
||||
if value == "disabled" {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return value != "disabled"
|
||||
}
|
||||
|
||||
func (ci *Evaluator) Evaluate(analysis *image.AnalysisResult) bool {
|
||||
|
@ -62,10 +62,7 @@ func (controller *DetailsController) Setup(v *gocui.View, header *gocui.View) er
|
||||
|
||||
// IsVisible indicates if the details view pane is currently initialized.
|
||||
func (controller *DetailsController) IsVisible() bool {
|
||||
if controller == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return controller != nil
|
||||
}
|
||||
|
||||
// CursorDown moves the cursor down in the details pane (currently indicates nothing).
|
||||
|
@ -182,10 +182,7 @@ func (controller *FileTreeController) Setup(v *gocui.View, header *gocui.View) e
|
||||
|
||||
// IsVisible indicates if the file tree view pane is currently initialized
|
||||
func (controller *FileTreeController) IsVisible() bool {
|
||||
if controller == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return controller != nil
|
||||
}
|
||||
|
||||
// resetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
|
||||
|
@ -86,10 +86,7 @@ func (vm *FileTreeViewModel) bufferIndexUpperBound() int {
|
||||
|
||||
// IsVisible indicates if the file tree view pane is currently initialized
|
||||
func (vm *FileTreeViewModel) IsVisible() bool {
|
||||
if vm == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return vm != nil
|
||||
}
|
||||
|
||||
// resetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
|
||||
|
@ -135,10 +135,7 @@ func (controller *LayerController) height() uint {
|
||||
|
||||
// IsVisible indicates if the layer view pane is currently initialized.
|
||||
func (controller *LayerController) IsVisible() bool {
|
||||
if controller == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return controller != nil
|
||||
}
|
||||
|
||||
// PageDown moves to next page putting the cursor on top
|
||||
|
@ -40,10 +40,7 @@ func (controller *StatusController) Setup(v *gocui.View, header *gocui.View) err
|
||||
|
||||
// IsVisible indicates if the status view pane is currently initialized.
|
||||
func (controller *StatusController) IsVisible() bool {
|
||||
if controller == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return controller != nil
|
||||
}
|
||||
|
||||
// CursorDown moves the cursor down in the details pane (currently indicates nothing).
|
||||
|
Loading…
x
Reference in New Issue
Block a user