performance optimization in 54
This commit is contained in:
@@ -11,7 +11,6 @@ num = "*"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = "*"
|
criterion = "*"
|
||||||
|
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "benchmark"
|
name = "benchmark"
|
||||||
harness = false
|
harness = false
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ path = "src/lib.rs"
|
|||||||
name = "euler54"
|
name = "euler54"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rstest = "*"
|
rstest = "*"
|
||||||
|
|
||||||
@@ -21,6 +19,8 @@ criterion = "*"
|
|||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
debug = true
|
debug = true
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "benchmark"
|
name = "benchmark"
|
||||||
|
|||||||
@@ -51,10 +51,7 @@ impl Cards {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn have_matching_suits(&self) -> bool {
|
pub fn have_matching_suits(&self) -> bool {
|
||||||
self.array[1..]
|
self.suit_hashset.len() == 1
|
||||||
.iter()
|
|
||||||
.zip(self.array[..4].iter())
|
|
||||||
.all(|(c1, c2)| c1.suit == c2.suit)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn contain_all_values_of(&self, values: &Values) -> bool {
|
pub fn contain_all_values_of(&self, values: &Values) -> bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user