Skip to content

Commit

Permalink
remove extra regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiaha committed Nov 21, 2024
1 parent f16d15c commit b8da503
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ impl TryFrom<&str> for TimeControl {

static GO_RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?x)
^go
r"(?x)^
go
(?:
\s+depth\s+(?P<depth>\d+) |
\s+nodes\s+(?P<nodes>\d+) |
Expand All @@ -138,7 +138,7 @@ static GO_RE: LazyLock<Regex> = LazyLock::new(|| {
\s+mate\s+(?P<mate>\d+) |
\s+movestogo\s+(?P<movestogo>\d+)
)*
$",
$",
)
.expect("Go regex should be valid.")
});
Expand Down
20 changes: 0 additions & 20 deletions src/uci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,26 +170,6 @@ impl UCICommand {
}
}

static GO_RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?x)^
go
(?:
\s+depth\s+(?P<depth>\d+) |
\s+nodes\s+(?P<nodes>\d+) |
\s+movetime\s+(?P<movetime>\d+) |
\s+wtime\s+(?P<wtime>\d+) |
\s+btime\s+(?P<btime>\d+) |
\s+winc\s+(?P<winc>\d+) |
\s+binc\s+(?P<binc>\d+) |
\s+mate\s+(?P<mate>\d+) |
\s+movestogo\s+(?P<movestogo>\d+)
)*
$",
)
.expect("Failed to compile go regex.")
});

static POSITION_RE: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?x)^
Expand Down

0 comments on commit b8da503

Please sign in to comment.