mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
packet_analysis/Dispatcher: Do not index table twice
It's okay to return the nullptr that's in the table, no need to check for != nullptr before dereferencing again.
This commit is contained in:
parent
e56ef0fd9b
commit
9bebd93c06
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ void Dispatcher::Register(uint32_t identifier, AnalyzerPtr analyzer) {
|
|||
|
||||
const AnalyzerPtr& Dispatcher::Lookup(uint32_t identifier) const {
|
||||
int64_t index = identifier - lowest_identifier;
|
||||
if ( index >= 0 && index < static_cast<int64_t>(table.size()) && table[index] != nullptr )
|
||||
if ( index >= 0 && index < static_cast<int64_t>(table.size()) )
|
||||
return table[index];
|
||||
|
||||
return Analyzer::nil;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue