Home
last modified time | relevance | path

Searched refs:needle (Results 1 - 25 of 156) sorted by relevance

1234567

/third_party/rust/crates/memchr/bench/src/memmem/
H A Dinputs.rs22 /// The needle to search for.
23 pub needle: &'static str,
33 Query { name: "fn-strength", needle: "fn strength", count: 0 },
36 needle: "fn strength(",
39 Query { name: "fn-quux", needle: "fn quux(", count: 0 },
44 needle: "pub fn from_str(",
49 Query { name: "fn-is-empty", needle: "fn is_empty(", count: 17 },
50 Query { name: "fn", needle: "fn", count: 2985 },
51 Query { name: "paren", needle: "(", count: 30193 },
52 Query { name: "let", needle
[all...]
H A Dimp.rs29 pub(crate) fn oneshot(haystack: &str, needle: &str) -> bool {
30 memmem::find(haystack.as_bytes(), needle.as_bytes()).is_some()
34 needle: &str,
36 let finder = memmem::Finder::new(needle).into_owned();
42 needle: &'a str,
44 memmem::find_iter(haystack.as_bytes(), needle.as_bytes())
47 pub(crate) fn prebuiltiter(needle: &str) -> PrebuiltIter {
48 PrebuiltIter(memmem::Finder::new(needle).into_owned())
67 pub(crate) fn oneshot(haystack: &str, needle: &str) -> bool {
68 memmem::rfind(haystack.as_bytes(), needle
[all...]
H A Dsliceslice.rs21 specific needle with one specific haystack, and each iteration is a single
50 .map(|needle| memmem::Finder::new(needle.as_bytes())) in search_short_haystack()
72 .map(|needle| { in search_short_haystack()
75 .build_forward(needle) in search_short_haystack()
97 for (i, needle) in needles.iter().enumerate() { in search_short_haystack()
99 black_box(haystack.contains(needle)); in search_short_haystack()
118 .map(|&needle| unsafe { in search_short_haystack()
119 DynamicAvx2Searcher::new(needle.as_bytes()) in search_short_haystack()
148 .map(|needle| memme in search_long_haystack()
[all...]
/third_party/rust/crates/memchr/src/memmem/
H A Dmod.rs7 the empty needle, the standard library reports matches only at valid UTF-8
51 # Example: repeating a search for the same needle
54 measurable in some workloads. In cases where the same needle is used to search
103 needle: Vec<u8> in qc_fwd_matches_naive()
105 proptests::matches_naive(false, &haystack, &needle, $fwd) in qc_fwd_matches_naive()
118 needle: Vec<u8> in qc_rev_matches_naive()
120 proptests::matches_naive(true, &haystack, &needle, $rev) in qc_rev_matches_naive()
169 /// with respect to both the needle and the haystack. That is, this runs
170 /// in `O(needle.len() + haystack.len())` time.
192 needle in find_iter()
557 pub fn needle(&self) -> &[u8] { needle() functions
688 pub fn needle(&self) -> &[u8] { needle() functions
873 fn needle(&self) -> &[u8] { needle() functions
1070 fn needle(&self) -> &[u8] { needle() functions
[all...]
H A Dtwoway.rs18 /// `n ~ len(needle)` and `m ~ len(haystack)`.
25 /// (3) this will detect bytes that are believed to be rare in the needle and
39 /// 1) Do something to detect a "critical" position in the needle.
40 /// 2) For the current position in the haystack, look if needle[critical..]
42 /// 3) If so, look if needle[..critical] matches.
52 /// for any b in the needle.
56 /// position (the length of the needle). This is essentially the shift
58 /// in the needle.
63 /// A critical position in needle. Specifically, this position corresponds
64 /// to beginning of either the minimal or maximal suffix in needle
[all...]
H A Drabinkarp.rs7 to compute a needle hash and zip through the haystack when compared to
17 requires space proportional to the alphabet and the needle. If we, for
34 /// Whether RK is believed to be very fast for the given needle/haystack.
39 /// Search for the first occurrence of needle in haystack using Rabin-Karp.
40 pub(crate) fn find(haystack: &[u8], needle: &[u8]) -> Option<usize> {
41 find_with(&NeedleHash::forward(needle), haystack, needle)
44 /// Search for the first occurrence of needle in haystack using Rabin-Karp with
45 /// a pre-computed needle hash.
49 needle
[all...]
H A Dgenericsimd.rs5 /// The minimum length of a needle required for this algorithm. The minimum
10 /// The maximum length of a needle required for this algorithm.
13 /// length needle. (Perhaps that suggests there are missing optimizations.)
22 /// in the size of the needle and haystack, and we want to keep that additive.
29 /// The rare-medium-needle, for example, gets about 5% faster by using this
43 /// needle is very quick, even on pathological inputs. This is much better than
64 pub(crate) fn new(ninfo: &NeedleInfo, needle: &[u8]) -> Option<Forward> {
66 // If the needle is too short or too long, give up. Also, give up
70 if needle.len() < MIN_NEEDLE_LEN
71 || needle
[all...]
H A Drarebytes.rs3 /// This detector attempts to pick out two bytes in a needle that are predicted
12 /// needle to reduce space usage. This means that rare byte occurring after the
13 /// first 255 bytes in a needle will never be used.
16 /// The leftmost offset of the rarest byte in the needle, according to
18 /// rare1i <= i for all i where needle[i] == needle[rare1i].
20 /// The leftmost offset of the second rarest byte in the needle, according
22 /// rare2i <= i for all i where needle[i] == needle[rare2i].
31 /// byte needle i
[all...]
H A Dwasm.rs13 pub(crate) fn new(ninfo: &NeedleInfo, needle: &[u8]) -> Option<Forward> {
17 genericsimd::Forward::new(ninfo, needle).map(Forward)
32 needle: &[u8],
34 self.find_impl(haystack, needle)
39 fn find_impl(&self, haystack: &[u8], needle: &[u8]) -> Option<usize> { in find_impl()
40 unsafe { genericsimd::fwd_find::<v128>(&self.0, haystack, needle) } in find_impl()
52 needle: &[u8], in find()
54 super::Forward::new(ninfo, needle).unwrap().find(haystack, needle) in find()
67 let fwd = match super::Forward::new(&t.ninfo, &t.needle) { in prefilter_permutations()
[all...]
/third_party/ffmpeg/libavutil/tests/
H A Davstring.c58 const char * const needle[] = {"learned.", "unlearned.", "Unlearned"}; in main() local
86 #define TEST_STRNSTR(haystack, needle, hay_length, expected) \ in main()
87 ptr = av_strnstr(haystack, needle, hay_length); \ in main()
91 TEST_STRNSTR(haystack, needle [0], strlen(haystack), haystack+44); in main()
92 TEST_STRNSTR(haystack, needle [1], strlen(haystack), haystack+42); in main()
93 TEST_STRNSTR(haystack, needle [2], strlen(haystack), NULL ); in main()
97 #define TEST_STRIREPLACE(haystack, needle, expected) \ in main()
98 ptr = av_strireplace(haystack, needle, "instead"); \ in main()
107 TEST_STRIREPLACE(haystack, needle [0], "Education consists mainly in what we have uninstead"); in main()
108 TEST_STRIREPLACE(haystack, needle [ in main()
[all...]
/third_party/python/Objects/stringlib/
H A Dfastsearch.h62 /* use memchr if we can choose a needle without too many likely in find_char()
65 unsigned char needle = ch & 0xff; in find_char()
69 if (needle != 0) { in find_char()
71 void *candidate = memchr(p, needle, in find_char()
121 /* use memrchr if we can choose a needle without too many likely in rfind_char()
125 unsigned char needle = ch & 0xff; in rfind_char()
129 if (needle != 0) { in rfind_char()
131 void *candidate = memrchr(s, needle, in rfind_char()
177 LOG_STRING(needle, len_needle); LOG("\n"); \
186 STRINGLIB(_lex_search)(const STRINGLIB_CHAR *needle, Py_ssize_ argument
238 _factorize(const STRINGLIB_CHAR *needle, Py_ssize_t len_needle, Py_ssize_t *return_period) _factorize() argument
305 const STRINGLIB_CHAR *needle; STRINGLIB() local
316 _preprocess(const STRINGLIB_CHAR *needle, Py_ssize_t len_needle, STRINGLIB(prework) *p) _preprocess() argument
368 const STRINGLIB_CHAR *const needle = p->needle; _two_way() local
488 _two_way_find(const STRINGLIB_CHAR *haystack, Py_ssize_t len_haystack, const STRINGLIB_CHAR *needle, Py_ssize_t len_needle) _two_way_find() argument
501 _two_way_count(const STRINGLIB_CHAR *haystack, Py_ssize_t len_haystack, const STRINGLIB_CHAR *needle, Py_ssize_t len_needle, Py_ssize_t maxcount) _two_way_count() argument
[all...]
/third_party/rust/crates/memchr/src/memmem/prefilter/
H A Dmod.rs12 /// rarest byte in the needle has a frequency rank above this value, then no
17 /// the needle info required to run a prefilter.
27 /// Information about a needle, such as its RK hash and rare byte offsets.
32 /// Call this prefilter on the given haystack with the given needle.
37 needle: &[u8],
39 self.prefn.call(self.state, self.ninfo, haystack, needle)
92 needle: &[u8],
104 needle: &[u8], in simple_memchr_fallback()
107 crate::memchr(needle[rare], haystack).map(|i| i.saturating_sub(rare)) in simple_memchr_fallback()
129 needle in call()
446 let mut needle = vec![b'#'; needle_len]; new() variables
[all...]
H A Dfallback.rs7 The essence of this implementation is to identify two rare bytes in a needle
39 /// Look for a possible occurrence of needle. The position returned
53 needle: &[u8],
57 let (rare1, rare2) = ninfo.rarebytes.as_rare_bytes(needle);
61 // needle.
95 fn freqy_find(haystack: &[u8], needle: &[u8]) -> Option<usize> { in freqy_find()
96 let ninfo = NeedleInfo::new(needle); in freqy_find()
98 find(&mut prestate, &ninfo, haystack, needle) in freqy_find()
/third_party/node/deps/undici/src/node_modules/@fastify/busboy/deps/streamsearch/
H A Dsbmh.js32 function SBMH (needle) {
33 if (typeof needle === 'string') {
34 needle = Buffer.from(needle)
37 if (!Buffer.isBuffer(needle)) {
38 throw new TypeError('The needle has to be a String or a Buffer.')
41 const needleLength = needle.length
44 throw new Error('The needle cannot be an empty String/Buffer.')
48 throw new Error('The needle cannot have a length bigger than 256.')
57 this._needle = needle
[all...]
/third_party/skia/third_party/externals/angle2/src/compiler/translator/TranslatorMetalDirect/
H A DDebugSink.h17 StringObserver(const std::string &needle) : needle(needle) { ASSERT(!needle.empty()); } in StringObserver() argument
21 if (needle[currPos] == c) in observe()
24 if (currPos == needle.size()) in observe()
37 const std::string &getNeedle() const { return needle; } in getNeedle()
42 std::string needle; member in sh::StringObserver
81 void watch(std::string const &needle) in watch() argument
83 if (!needle in watch()
138 const std::string &needle = observer.getNeedle(); onWrite() local
[all...]
/third_party/rust/crates/memchr/src/memmem/x86/
H A Davx.rs22 needle: &[u8],
27 genericsimd::Forward::new(ninfo, needle).map(Forward)
42 needle: &[u8],
47 unsafe { self.find_impl(haystack, needle) }
61 needle: &[u8], in find_impl()
64 genericsimd::fwd_find::<__m128i>(&self.0, haystack, needle) in find_impl()
66 genericsimd::fwd_find::<__m256i>(&self.0, haystack, needle) in find_impl()
84 needle: &[u8],
96 needle: &[u8],
111 needle in find()
[all...]
H A Dsse.rs13 pub(crate) fn new(ninfo: &NeedleInfo, needle: &[u8]) -> Option<Forward> {
17 genericsimd::Forward::new(ninfo, needle).map(Forward)
32 needle: &[u8],
36 unsafe { self.find_impl(haystack, needle) }
50 needle: &[u8], in find_impl()
52 genericsimd::fwd_find::<__m128i>(&self.0, haystack, needle) in find_impl()
64 needle: &[u8], in find()
66 super::Forward::new(ninfo, needle).unwrap().find(haystack, needle) in find()
81 let fwd = match super::Forward::new(&t.ninfo, &t.needle) { in prefilter_permutations()
[all...]
/third_party/typescript/tests/baselines/reference/
H A DcontrolFlowPropertyDeclarations.js48 * @param {string} needle String to search for
51 function endsWith(haystack, needle) {
52 return haystack.slice(-needle.length) === needle;
60 * @param {string} needle String to search for
63 function trimEnd(haystack, needle) {
64 return endsWith(haystack, needle)
65 ? haystack.slice(0, -needle.length)
196 * @param {string} needle String to search for
199 function endsWith(haystack, needle) {
[all...]
/third_party/backends/lib/
H A Dstrcasestr.c44 register const unsigned char *haystack, *needle; in strcasestr() local
48 needle = (const unsigned char *) pneedle; in strcasestr()
50 b = *needle; in strcasestr()
60 c = *++needle; in strcasestr()
63 ++needle; in strcasestr()
90 rneedle = needle; in strcasestr()
98 a = *++needle; in strcasestr()
104 a = *++needle; in strcasestr()
108 needle = rneedle; /* took the register-poor approach */ in strcasestr()
/third_party/rust/crates/regex/src/
H A Dfind_byte.rs1 /// Searches for the given needle in the given haystack.
5 pub fn find_byte(needle: u8, haystack: &[u8]) -> Option<usize> { in find_byte()
7 fn imp(needle: u8, haystack: &[u8]) -> Option<usize> { in find_byte()
8 haystack.iter().position(|&b| b == needle) in find_byte()
12 fn imp(needle: u8, haystack: &[u8]) -> Option<usize> { in find_byte()
14 memchr(needle, haystack) in find_byte()
17 imp(needle, haystack) in find_byte()
/third_party/skia/third_party/externals/abseil-cpp/absl/strings/internal/
H A Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch()
95 const char* needlestart = needle; in int_memmatch()
103 ? *needle in int_memmatch()
104 : absl::ascii_tolower(static_cast<unsigned char>(*needle)); in int_memmatch()
106 if (++needle == needleend) { in int_memmatch()
109 } else if (needle != needlestart) { in int_memmatch()
111 haystack -= needle - needlestart; // for loop will advance one more in int_memmatch()
112 needle = needlestart; in int_memmatch()
89 int_memmatch(const char* haystack, size_t haylen, const char* needle, size_t neelen) int_memmatch() argument
/third_party/rust/crates/memchr/src/tests/memchr/
H A Diter.rs53 needle: u8, data: Vec<u8>, take_side: Vec<bool> in qc_memchr_double_ended_iter()
59 let iter = Memchr::new(needle, &data); in qc_memchr_double_ended_iter()
63 all_found.iter().cloned().eq(positions1(needle, &data)) in qc_memchr_double_ended_iter()
99 let needle = 0; in qc_memchr1_iter()
100 let answer = positions1(needle, &data); in qc_memchr1_iter()
101 answer.eq(Memchr::new(needle, &data)) in qc_memchr1_iter()
105 let needle = 0; in qc_memchr1_rev_iter()
106 let answer = positions1(needle, &data); in qc_memchr1_rev_iter()
107 answer.rev().eq(Memchr::new(needle, &data).rev()) in qc_memchr1_rev_iter()
142 let needle in qc_memchr1_iter_size_hint()
[all...]
/third_party/rust/crates/memchr/src/memchr/x86/
H A Dmod.rs36 ($fnty:ty, $name:ident, $haystack:ident, $($needle:ident),+) => {{
43 fn detect($($needle: u8),+, haystack: &[u8]) -> Option<usize> { in detect()
58 mem::transmute::<FnRaw, $fnty>(fun)($($needle),+, haystack) in detect()
68 mem::transmute::<FnRaw, $fnty>(fun)($($needle),+, $haystack)
85 ($fnty:ty, $name:ident, $haystack:ident, $($needle:ident),+) => {{
87 unsafe { sse2::$name($($needle),+, $haystack) }
89 fallback::$name($($needle),+, $haystack)
/third_party/skia/include/core/
H A DSkStringView.h106 size_type find(string_view needle, size_type pos = 0) const { in find() argument
107 if (needle.length() == 0) { in find()
110 if (this->length() < needle.length()) { in find()
115 const char* end = start + this->length() - needle.length() + 1; in find()
116 while ((match = (const char*)(memchr(start, needle[0], (size_t)(end - start))))) { in find()
117 if (!memcmp(match, needle.data(), needle.length())) { in find()
126 bool contains(string_view needle) const { in contains()
127 return this->find(needle) != npos; in contains()
/third_party/rust/crates/memchr/src/memchr/
H A Dc.rs8 pub fn memchr(needle: u8, haystack: &[u8]) -> Option<usize> { in memchr()
13 needle as c_int, in memchr()
26 pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> { in memrchr()
35 needle as c_int, in memrchr()

Completed in 9 milliseconds

1234567