Skip to content

Commit d7e86fa

Browse files
committed
Fix saerch condition to true
1 parent f4592d8 commit d7e86fa

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "lldb",
9+
"request": "launch",
10+
"name": "Debug",
11+
"program": "${workspaceFolder}/a.out",
12+
"args": [],
13+
"cwd": "${workspaceFolder}"
14+
}
15+
]
16+
}

a.out

58.6 KB
Binary file not shown.

a.out.dSYM/Contents/Info.plist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>com.apple.xcode.dsym.a.out</string>
9+
<key>CFBundleInfoDictionaryVersion</key>
10+
<string>6.0</string>
11+
<key>CFBundlePackageType</key>
12+
<string>dSYM</string>
13+
<key>CFBundleSignature</key>
14+
<string>????</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.0</string>
17+
<key>CFBundleVersion</key>
18+
<string>1</string>
19+
</dict>
20+
</plist>
122 KB
Binary file not shown.

boyer_moore_horspool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct SearchPattern {
2929
std::optional<std::size_t> boyer_moore_horspool(SearchPattern pattern, std::string_view haystack) {
3030
for (std::size_t h = 0; h < haystack.length() - pattern.needle.length() + 1;) {
3131
// Search this placement of the needle.
32-
bool found = false;
32+
bool found = true;
3333
for (std::size_t n = pattern.needle.length() - 1; ; n--) {
3434
// Check the needle in reverse.
3535
if (haystack[h + n] != pattern.needle[n]) {

0 commit comments

Comments
 (0)