Added some inline.
This commit is contained in:
@@ -92,17 +92,18 @@ impl convert::From<u64> for ByteNgram {
|
||||
|
||||
pub struct ByteNgramReader<R: Read> {
|
||||
inner: Bytes<R>,
|
||||
token: u64,
|
||||
count: u64,
|
||||
token: u64,
|
||||
mask: u64,
|
||||
}
|
||||
|
||||
impl<R: Read> ByteNgramReader<R> {
|
||||
#[inline]
|
||||
pub fn new(inner: R) -> Self {
|
||||
ByteNgramReader {
|
||||
inner: inner.bytes(),
|
||||
token: 0,
|
||||
count: 0,
|
||||
token: 0,
|
||||
mask: 0,
|
||||
}
|
||||
}
|
||||
@@ -111,6 +112,7 @@ impl<R: Read> ByteNgramReader<R> {
|
||||
impl<R: Read> Iterator for ByteNgramReader<R> {
|
||||
type Item = ByteNgram;
|
||||
|
||||
#[inline]
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.mask == 0 {
|
||||
if let Some(Ok(byte)) = self.inner.next() {
|
||||
|
||||
Reference in New Issue
Block a user