From a7dbafe3736b9b1499203fb9f80a8a9f6e057ae9 Mon Sep 17 00:00:00 2001 From: Tshaka Lekholoane Date: Wed, 13 Nov 2024 14:57:03 +0200 Subject: [PATCH] doc: fix typographical errors PR #167 --- src/arch/all/memchr.rs | 6 +++--- src/arch/generic/memchr.rs | 2 +- src/arch/x86_64/memchr.rs | 4 ++-- src/arch/x86_64/sse2/memchr.rs | 2 +- src/vector.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/arch/all/memchr.rs b/src/arch/all/memchr.rs index 62fe2a3..7f327f8 100644 --- a/src/arch/all/memchr.rs +++ b/src/arch/all/memchr.rs @@ -13,7 +13,7 @@ The `One` searcher also provides a [`One::count`] routine for efficiently counting the number of times a single byte occurs in a haystack. This is useful, for example, for counting the number of lines in a haystack. This routine exists because it is usually faster, especially with a high match -count, then using [`One::find`] repeatedly. ([`OneIter`] specializes its +count, than using [`One::find`] repeatedly. ([`OneIter`] specializes its `Iterator::count` implementation to use this routine.) Only one, two and three bytes are supported because three bytes is about @@ -456,7 +456,7 @@ impl Two { } // And now we start our search at a guaranteed aligned position. - // The first iteration of the loop below will overlap with the the + // The first iteration of the loop below will overlap with the // unaligned chunk above in cases where the search starts at an // unaligned offset, but that's okay as we're only here if that // above didn't find a match. @@ -720,7 +720,7 @@ impl Three { } // And now we start our search at a guaranteed aligned position. - // The first iteration of the loop below will overlap with the the + // The first iteration of the loop below will overlap with the // unaligned chunk above in cases where the search starts at an // unaligned offset, but that's okay as we're only here if that // above didn't find a match. diff --git a/src/arch/generic/memchr.rs b/src/arch/generic/memchr.rs index 580b3cc..de61fd8 100644 --- a/src/arch/generic/memchr.rs +++ b/src/arch/generic/memchr.rs @@ -12,7 +12,7 @@ Generic crate-internal routines for the `memchr` family of functions. // // While the routine below is fairly long and perhaps intimidating, the basic // idea is actually very simple and can be expressed straight-forwardly in -// pseudo code. The psuedo code below is written for 128 bit vectors, but the +// pseudo code. The pseudo code below is written for 128 bit vectors, but the // actual code below works for anything that implements the Vector trait. // // needle = (n1 << 15) | (n1 << 14) | ... | (n1 << 1) | n1 diff --git a/src/arch/x86_64/memchr.rs b/src/arch/x86_64/memchr.rs index fcb1399..edb6d43 100644 --- a/src/arch/x86_64/memchr.rs +++ b/src/arch/x86_64/memchr.rs @@ -46,8 +46,8 @@ the CPU supports. /// /// # Safety /// -/// Primarily callers must that `$fnty` is a correct function pointer type and -/// not something else. +/// Primarily callers must ensure that `$fnty` is a correct function pointer +/// type and not something else. /// /// Callers must also ensure that `$memchrty::$memchrfind` corresponds to a /// routine that returns a valid function pointer when a match is found. That diff --git a/src/arch/x86_64/sse2/memchr.rs b/src/arch/x86_64/sse2/memchr.rs index c6f75df..79572b8 100644 --- a/src/arch/x86_64/sse2/memchr.rs +++ b/src/arch/x86_64/sse2/memchr.rs @@ -10,7 +10,7 @@ The `One` searcher also provides a [`One::count`] routine for efficiently counting the number of times a single byte occurs in a haystack. This is useful, for example, for counting the number of lines in a haystack. This routine exists because it is usually faster, especially with a high match -count, then using [`One::find`] repeatedly. ([`OneIter`] specializes its +count, than using [`One::find`] repeatedly. ([`OneIter`] specializes its `Iterator::count` implementation to use this routine.) Only one, two and three bytes are supported because three bytes is about diff --git a/src/vector.rs b/src/vector.rs index d86fbca..4379798 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -78,7 +78,7 @@ pub(crate) trait Vector: Copy + core::fmt::Debug { /// a slightly different representation. We could do extra work to unify the /// representations, but then would require additional costs in the hot path /// for `memchr` and `packedpair`. So instead, we abstraction over the specific -/// representation with this trait an ddefine the operations we actually need. +/// representation with this trait and define the operations we actually need. pub(crate) trait MoveMask: Copy + core::fmt::Debug { /// Return a mask that is all zeros except for the least significant `n` /// lanes in a corresponding vector. @@ -344,7 +344,7 @@ mod aarch64neon { /// This is the only interesting implementation of this routine. /// Basically, instead of doing the "shift right narrow" dance, we use - /// adajacent folding max to determine whether there are any non-zero + /// adjacent folding max to determine whether there are any non-zero /// bytes in our mask. If there are, *then* we'll do the "shift right /// narrow" dance. In benchmarks, this does lead to slightly better /// throughput, but the win doesn't appear huge.