mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Merge remote-tracking branch 'origin/topic/jazoff/fuzz-size-limit-speedup'
- Factored check into more descriptive function: ExceedsChunkLimit() * origin/topic/jazoff/fuzz-size-limit-speedup: Speed up ChunkCount validity check
This commit is contained in:
commit
05f829c727
4 changed files with 18 additions and 5 deletions
|
@ -47,9 +47,18 @@ public:
|
|||
bool Valid(int chunk_count_limit = MAX_CHUNK_COUNT) const;
|
||||
|
||||
/**
|
||||
* @param chunk_count_limit Number of chunks to stop counting at (zero
|
||||
* means "never stop").
|
||||
* @return the number of chunks in the fuzz buffer object
|
||||
*/
|
||||
int ChunkCount() const;
|
||||
int ChunkCount(int chunk_count_limit = 0) const;
|
||||
|
||||
/**
|
||||
* @param Maximum number of chunks to permit the FuzzBuffer to have.
|
||||
* @return Whether the FuzzBuffer exceeds the desired chunk count limit.
|
||||
*/
|
||||
bool ExceedsChunkLimit(int chunk_count_limit) const
|
||||
{ return ChunkCount(chunk_count_limit + 1) > chunk_count_limit; }
|
||||
|
||||
/**
|
||||
* @return the next chunk to deliver, if one could be extracted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue