Home
last modified time | relevance | path

Searched refs:needle (Results 1 – 25 of 232) sorted by relevance

12345678910

/external/rust/crates/bstr/src/search/
Dtwoway.rs33 needle: CowBytes<'b>, field
54 pub fn forward(needle: &'b [u8]) -> TwoWay<'b> { in forward()
55 let freqy = Freqy::forward(needle); in forward()
56 if needle.is_empty() { in forward()
58 needle: CowBytes::new(needle), in forward()
65 let min_suffix = Suffix::forward(needle, SuffixKind::Minimal); in forward()
66 let max_suffix = Suffix::forward(needle, SuffixKind::Maximal); in forward()
73 let shift = Shift::forward(needle, period_lower_bound, critical_pos); in forward()
74 let needle = CowBytes::new(needle); in forward() localVariable
75 TwoWay { needle, freqy, critical_pos, shift } in forward()
[all …]
Dtests.rs64 for &(needle, haystack, expected_fwd, _) in SEARCH_TESTS { in run_search_tests_fwd()
65 let (n, h) = (needle.as_bytes(), haystack.as_bytes()); in run_search_tests_fwd()
86 for &(needle, haystack, _, expected_rev) in SEARCH_TESTS { in run_search_tests_rev()
87 let (n, h) = (needle.as_bytes(), haystack.as_bytes()); in run_search_tests_rev()
118 needle: Vec<u8>,
123 &needle,
130 needle: Vec<u8>,
135 &needle,
186 needle: &[u8], in prop_matches_naive()
191 naive_rfind(needle, haystack) == search(needle, haystack) in prop_matches_naive()
[all …]
Dprefilter.rs151 pub fn forward(needle: &[u8]) -> Freqy { in forward()
152 if needle.is_empty() { in forward()
158 let (mut rare1, mut rare1i) = (needle[0], 0); in forward()
159 let (mut rare2, mut rare2i) = (needle[0], 0); in forward()
160 if needle.len() >= 2 { in forward()
161 rare2 = needle[1]; in forward()
168 for (i, b) in needle.bytes().enumerate().skip(2) { in forward()
182 let needle_len = needle.len(); in forward()
187 pub fn reverse(needle: &[u8]) -> Freqy { in reverse()
188 if needle.is_empty() { in reverse()
[all …]
/external/llvm-project/libc/test/src/string/
Dstrstr_test.cpp14 const char *needle = "a"; in TEST() local
15 ASSERT_STREQ(__llvm_libc::strstr(haystack, needle), nullptr); in TEST()
20 const char *needle = ""; in TEST() local
21 ASSERT_STREQ(__llvm_libc::strstr(haystack, needle), haystack); in TEST()
26 const char *needle = "12345"; in TEST() local
27 ASSERT_STREQ(__llvm_libc::strstr(haystack, needle), nullptr); in TEST()
32 const char *needle = ""; in TEST() local
33 ASSERT_STREQ(__llvm_libc::strstr(haystack, needle), ""); in TEST()
46 const char *needle = "12345"; in TEST() local
47 ASSERT_STREQ(__llvm_libc::strstr(haystack, needle), "12345"); in TEST()
[all …]
/external/perfetto/ui/src/base/
Dbinary_search.ts20 haystack: Numbers, needle: number, i: number, j: number): number {
23 return (needle >= haystack[i]) ? i : -1;
28 if (needle < midValue) {
29 return searchImpl(haystack, needle, i, mid);
31 return searchImpl(haystack, needle, mid, j);
36 haystack: Numbers, needle: number, i: number, j: number): Range {
39 if (haystack[i] <= needle) {
49 if (needle < midValue) {
50 return searchRangeImpl(haystack, needle, i, mid);
51 } else if (needle > midValue) {
[all …]
/external/angle/src/compiler/translator/TranslatorMetalDirect/
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;
81 void watch(std::string const &needle) in watch() argument
83 if (!needle.empty()) in watch()
85 mObservers.emplace_back(needle); in watch()
138 const std::string &needle = observer.getNeedle(); in onWrite() local
139 (void)needle; in onWrite()
/external/iproute2/tc/
Dem_nbyte.c44 struct bstr *needle = args; in nbyte_parse_eopt() local
55 if (needle->len <= 0) in nbyte_parse_eopt()
93 nb.len = needle->len; in nbyte_parse_eopt()
99 addraw_l(n, MAX_MSG, needle->data, needle->len); in nbyte_parse_eopt()
110 __u8 *needle; in nbyte_print_eopt() local
122 needle = data + sizeof(*nb); in nbyte_print_eopt()
125 fprintf(fd, "%02x ", needle[i]); in nbyte_print_eopt()
129 fprintf(fd, "%c", isprint(needle[i]) ? needle[i] : '.'); in nbyte_print_eopt()
/external/rust/crates/regex/src/literal/
Dimp.rs907 let needle = vec![0, 1, 1, 0]; in bm_skip_reset_bug() localVariable
909 let searcher = BoyerMooreSearch::new(needle); in bm_skip_reset_bug()
917 let needle = vec![0, 0]; in bm_backstop_underflow_bug() localVariable
919 let searcher = BoyerMooreSearch::new(needle); in bm_backstop_underflow_bug()
927 let needle = vec![91]; in bm_naive_off_by_one_bug() localVariable
929 let naive_offset = naive_find(&needle, &haystack).unwrap(); in bm_naive_off_by_one_bug()
942 let needle = vec![1, 1, 1, 1, 32, 32, 87]; in bm_memchr_fallback_indexing_bug() localVariable
944 haystack.extend(needle.clone()); in bm_memchr_fallback_indexing_bug()
946 let searcher = BoyerMooreSearch::new(needle); in bm_memchr_fallback_indexing_bug()
959 let needle = b"clone_created".to_vec(); in bm_backstop_boundary() localVariable
[all …]
/external/rust/crates/regex/src/
Dfind_byte.rs5 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()
/external/openscreen/third_party/abseil/src/absl/strings/internal/
Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch() argument
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()
/external/rust/crates/grpcio-sys/grpc/third_party/abseil-cpp/absl/strings/internal/
Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch() argument
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()
/external/libtextclassifier/abseil-cpp/absl/strings/internal/
Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch() argument
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()
/external/webrtc/third_party/abseil-cpp/absl/strings/internal/
Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch() argument
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()
/external/angle/third_party/abseil-cpp/absl/strings/internal/
Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch() argument
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()
/external/abseil-cpp/absl/strings/internal/
Dmemutil.h90 const char* needle, size_t neelen) { in int_memmatch() argument
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()
/external/llvm-project/libc/fuzzing/string/
Dstrstr_fuzz.cpp55 const char *needle = reinterpret_cast<const char *>(container); in LLVMFuzzerTestOneInput() local
57 const char *result = __llvm_libc::strstr(haystack, needle); in LLVMFuzzerTestOneInput()
61 const size_t needle_size = __llvm_libc::strlen(needle); in LLVMFuzzerTestOneInput()
66 if (simple_memcmp(needle, result, needle_size) != 0) in LLVMFuzzerTestOneInput()
72 if (simple_memcmp(needle, haystack_ptr, needle_size) == 0) in LLVMFuzzerTestOneInput()
79 if (simple_memcmp(needle, haystack + i, needle_size) == 0) in LLVMFuzzerTestOneInput()
/external/rust/crates/bstr/src/
Dext_slice.rs613 fn contains_str<B: AsRef<[u8]>>(&self, needle: B) -> bool { in contains_str()
614 self.find(needle).is_some() in contains_str()
684 fn find<B: AsRef<[u8]>>(&self, needle: B) -> Option<usize> { in find()
685 Finder::new(needle.as_ref()).find(self.as_bytes()) in find()
721 fn rfind<B: AsRef<[u8]>>(&self, needle: B) -> Option<usize> { in rfind()
722 FinderReverse::new(needle.as_ref()).rfind(self.as_bytes()) in rfind()
765 needle: &'a B, in find_iter()
767 Find::new(self.as_bytes(), needle.as_ref()) in find_iter()
810 needle: &'a B, in rfind_iter()
812 FindReverse::new(self.as_bytes(), needle.as_ref()) in rfind_iter()
[all …]
/external/rust/crates/memchr/src/tests/
Diter.rs52 needle: u8, data: Vec<u8>, take_side: Vec<bool>
58 let iter = Memchr::new(needle, &data);
62 all_found.iter().cloned().eq(positions1(needle, &data))
98 let needle = 0; localVariable
99 let answer = positions1(needle, &data);
100 answer.eq(Memchr::new(needle, &data))
104 let needle = 0; localVariable
105 let answer = positions1(needle, &data);
106 answer.rev().eq(Memchr::new(needle, &data).rev())
141 let needle = 0; localVariable
[all …]
/external/google-breakpad/src/common/linux/
Dlinux_libc_support.cc123 const char* my_strchr(const char* haystack, char needle) { in my_strchr() argument
124 while (*haystack && *haystack != needle) in my_strchr()
126 if (*haystack == needle) in my_strchr()
131 const char* my_strrchr(const char* haystack, char needle) { in my_strrchr() argument
134 if (*haystack == needle) in my_strrchr()
141 void* my_memchr(const void* src, int needle, size_t src_len) { in my_memchr() argument
145 if (*p == needle) in my_memchr()
/external/rust/crates/memchr/src/x86/
Dmod.rs32 ($fnty:ty, $name:ident, $haystack:ident, $($needle:ident),+) => {{
40 fn detect($($needle: u8),+, haystack: &[u8]) -> Option<usize> {
51 mem::transmute::<FnRaw, $fnty>(fun)($($needle),+, haystack)
57 mem::transmute::<FnRaw, $fnty>(fun)($($needle),+, $haystack)
68 ($fnty:ty, $name:ident, $haystack:ident, $($needle:ident),+) => {{
70 unsafe { sse2::$name($($needle),+, $haystack) }
72 fallback::$name($($needle),+, $haystack)
/external/bcc/examples/usdt_sample/scripts/
Dbpf_text_shared.c11 char needle[] = "FILTER_STRING"; ///< The FILTER STRING is replaced by python code. in filter() local
12 char haystack[sizeof(needle)] = {}; in filter()
14 for (int i = 0; i < sizeof(needle) - 1; ++i) { in filter()
15 if (needle[i] != haystack[i]) { in filter()
/external/ImageMagick/MagickCore/
Dstring-private.h50 const char *needle) in StringLocateSubstring() argument
53 return(strcasestr(haystack,needle)); in StringLocateSubstring()
63 if (!haystack || !needle) in StringLocateSubstring()
65 length_needle=strlen(needle); in StringLocateSubstring()
75 unsigned char c2 = (unsigned char) needle[j]; in StringLocateSubstring()
/external/llvm-project/pstl/test/std/algorithms/alg.nonmodifying/
Dcount.pass.cpp26 operator()(Policy&& exec, Iterator first, Iterator last, T needle) in operator ()()
28 auto expected = std::count(first, last, needle); in operator ()()
29 auto result = std::count(exec, first, last, needle); in operator ()()
62 test(T needle, Predicate pred, Convert convert) in test() argument
71 invoke_on_all_policies(test_count(), in.begin(), in.end(), needle); in test()
74 invoke_on_all_policies(test_count(), in.cbegin(), in.cend(), needle); in test()
/external/rust/crates/memchr/src/
Dc.rs10 pub fn memchr(needle: u8, haystack: &[u8]) -> Option<usize> { in memchr()
14 needle as c_int, in memchr()
27 pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> { in memrchr()
35 needle as c_int, in memrchr()
/external/perfetto/src/base/
Dstring_utils.cc97 bool Contains(const std::string& haystack, const std::string& needle) { in Contains() argument
98 return haystack.find(needle) != std::string::npos; in Contains()
101 bool Contains(const std::string& haystack, const char needle) { in Contains() argument
102 return haystack.find(needle) != std::string::npos; in Contains()
105 size_t Find(const StringView& needle, const StringView& haystack) { in Find() argument
106 if (needle.empty()) in Find()
108 if (needle.size() > haystack.size()) in Find()
110 for (size_t i = 0; i < haystack.size() - (needle.size() - 1); ++i) { in Find()
111 if (strncmp(haystack.data() + i, needle.data(), needle.size()) == 0) in Find()

12345678910