fixing logic condition + removing redundant code

This commit is contained in:
mzack 2022-03-03 07:18:35 +01:00
parent 64bea4da8c
commit ea9f9c9c9a
2 changed files with 1 additions and 7 deletions

View File

@ -167,12 +167,6 @@ func (r *Result) Merge(result *Result) {
r.OutputExtracts = append(r.OutputExtracts, v) r.OutputExtracts = append(r.OutputExtracts, v)
} }
} }
for _, v := range result.OutputExtracts {
if _, ok := r.outputUnique[v]; !ok {
r.outputUnique[v] = struct{}{}
r.OutputExtracts = append(r.OutputExtracts, v)
}
}
for k, v := range result.DynamicValues { for k, v := range result.DynamicValues {
r.DynamicValues[k] = v r.DynamicValues[k] = v
} }

View File

@ -159,7 +159,7 @@ func (request *Request) processFile(filePath, input string, previousInternalEven
func (request *Request) processReader(reader io.Reader, filePath, input, totalBytesString string, previousInternalEvent output.InternalEvent) (*output.InternalWrappedEvent, []FileMatch, error) { func (request *Request) processReader(reader io.Reader, filePath, input, totalBytesString string, previousInternalEvent output.InternalEvent) (*output.InternalWrappedEvent, []FileMatch, error) {
fileReader := io.LimitReader(reader, request.maxSize) fileReader := io.LimitReader(reader, request.maxSize)
fileMatches, opResult := request.findMatchesWithReader(fileReader, input, filePath, totalBytesString, previousInternalEvent) fileMatches, opResult := request.findMatchesWithReader(fileReader, input, filePath, totalBytesString, previousInternalEvent)
if len(fileMatches) == 0 || opResult == nil { if opResult == nil && len(fileMatches) == 0 {
return nil, nil, emptyResultErr return nil, nil, emptyResultErr
} }