Skip to content

Commit

Permalink
Rename peek_next_free_id to peek_free_id (that it's the next is obvio…
Browse files Browse the repository at this point in the history
  • Loading branch information
domenukk authored May 23, 2024
1 parent e317ad0 commit b97a9a1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions libafl/src/corpus/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ where

/// Peek the next free corpus id
#[inline]
fn peek_next_free_id(&self) -> CorpusId {
self.inner.peek_next_free_id()
fn peek_free_id(&self) -> CorpusId {
self.inner.peek_free_id()
}

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/corpus/inmemory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ where

#[must_use]
/// Peek the next free corpus id
pub fn peek_next_free_id(&self) -> CorpusId {
pub fn peek_free_id(&self) -> CorpusId {
CorpusId::from(self.progressive_idx)
}

Expand Down Expand Up @@ -438,8 +438,8 @@ where

/// Peek the next free corpus id
#[inline]
fn peek_next_free_id(&self) -> CorpusId {
self.storage.peek_next_free_id()
fn peek_free_id(&self) -> CorpusId {
self.storage.peek_free_id()
}

#[inline]
Expand Down
4 changes: 2 additions & 2 deletions libafl/src/corpus/inmemory_ondisk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ where

/// Peek the next free corpus id
#[inline]
fn peek_next_free_id(&self) -> CorpusId {
self.inner.peek_next_free_id()
fn peek_free_id(&self) -> CorpusId {
self.inner.peek_free_id()
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion libafl/src/corpus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub trait Corpus: UsesInput + Serialize + for<'de> Deserialize<'de> {
fn next(&self, id: CorpusId) -> Option<CorpusId>;

/// Peek the next free corpus id
fn peek_next_free_id(&self) -> CorpusId;
fn peek_free_id(&self) -> CorpusId;

/// Get the prev corpus id
fn prev(&self, id: CorpusId) -> Option<CorpusId>;
Expand Down
2 changes: 1 addition & 1 deletion libafl/src/corpus/nop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ where

/// Peek the next free corpus id
#[inline]
fn peek_next_free_id(&self) -> CorpusId {
fn peek_free_id(&self) -> CorpusId {
CorpusId::from(0_usize)
}

Expand Down
4 changes: 2 additions & 2 deletions libafl/src/corpus/ondisk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ where

/// Peek the next free corpus id
#[inline]
fn peek_next_free_id(&self) -> CorpusId {
self.inner.peek_next_free_id()
fn peek_free_id(&self) -> CorpusId {
self.inner.peek_free_id()
}

/// Removes an entry from the corpus, returning it if it was present.
Expand Down
6 changes: 3 additions & 3 deletions libafl_libfuzzer/libafl_libfuzzer_runtime/src/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ where
fn next(&self, id: CorpusId) -> Option<CorpusId> {
self.mapping.enabled.next(id)
}
fn peek_next_free_id(&self) -> CorpusId {
self.mapping.peek_next_free_id()
fn peek_free_id(&self) -> CorpusId {
self.mapping.peek_free_id()
}

fn prev(&self, id: CorpusId) -> Option<CorpusId> {
Expand Down Expand Up @@ -359,7 +359,7 @@ where
maybe_last.ok_or_else(|| Error::illegal_argument("Can only get the last corpus ID."))
}

fn peek_next_free_id(&self) -> CorpusId {
fn peek_free_id(&self) -> CorpusId {
CorpusId::from(self.count)
}

Expand Down

0 comments on commit b97a9a1

Please sign in to comment.