Revert "Minor refactor (inlining)"
This reverts commit bb57673f8a01e77e42c38bbf5bab60fba8c63098. Actually, the symmetry with `is_repetition_2` is worth the slight extra verbosity.
This commit is contained in:
parent
bb57673f8a
commit
a321ce3f22
@ -57,7 +57,9 @@ fn is_repetition_2(n: usize) -> bool {
|
|||||||
|
|
||||||
fn is_repetition_n(n: usize) -> bool {
|
fn is_repetition_n(n: usize) -> bool {
|
||||||
let n = n.to_string();
|
let n = n.to_string();
|
||||||
(1..(n.len() / 2 + 1)).any(|i| equal_chunks(&n, i))
|
let l = n.len();
|
||||||
|
let d = l / 2;
|
||||||
|
(1..(d + 1)).any(|i| equal_chunks(&n, i))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn equal_chunks(n: &String, i: usize) -> bool {
|
fn equal_chunks(n: &String, i: usize) -> bool {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user