Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package plugins

import (
"context"
"sort"

"github.com/Velocidex/ordereddict"
"www.velocidex.com/golang/vfilter/arg_parser"
Expand All @@ -26,8 +25,9 @@ func (self _ChainPlugin) Call(
output_chan := make(chan types.Row)

queries := []types.StoredQuery{}

// Maintain definition order for the chain plugin.
members := scope.GetMembers(args)
sort.Strings(members)

go func() {
defer close(output_chan)
Expand Down
10 changes: 4 additions & 6 deletions protocols/protocol_lt.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (self LtDispatcher) Copy() LtDispatcher {

func intLt(lhs int64, b types.Any) bool {
switch b.(type) {
case int, int8, int16, int32, int64, uint8, uint16, uint32, uint64:
case bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64:
rhs, _ := utils.ToInt64(b)
return lhs < rhs
case float64, float32:
Expand All @@ -43,15 +43,13 @@ func intLt(lhs int64, b types.Any) bool {
}

func intEq(lhs int64, b types.Any) bool {
switch t := b.(type) {
case int, int8, int16, int32, int64, uint8, uint16, uint32, uint64:
switch b.(type) {
case bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64:
rhs, _ := utils.ToInt64(b)
return lhs == rhs
case float64, float32:
rhs, _ := utils.ToFloat(b)
return float64(lhs) == rhs
case bool:
return lhs != 0 == t
}
return false
}
Expand All @@ -75,7 +73,7 @@ func (self LtDispatcher) Lt(scope types.Scope, a types.Any, b types.Any) bool {
}

// If it is integer like, coerce to int.
case int, int8, int16, int32, int64, uint8, uint16, uint32, uint64:
case bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64:
if isTime(b) {
lhs, ok := utils.ToInt64(t)
if ok {
Expand Down