mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Handle deeply nested decks
This commit is contained in:
parent
c4d71eae2f
commit
f017525ea8
1 changed files with 4 additions and 1 deletions
|
@ -32,7 +32,10 @@ fn add_child_nodes(
|
||||||
) {
|
) {
|
||||||
while let Some((id, name)) = names.peek() {
|
while let Some((id, name)) = names.peek() {
|
||||||
let split_name: Vec<_> = name.split("::").collect();
|
let split_name: Vec<_> = name.split("::").collect();
|
||||||
match split_name.len() as u32 {
|
// protobuf refuses to decode messages with 100+ levels of nesting, and
|
||||||
|
// broken collections with such nesting have been found in the wild
|
||||||
|
let capped_len = split_name.len().min(99) as u32;
|
||||||
|
match capped_len {
|
||||||
l if l <= parent.level => {
|
l if l <= parent.level => {
|
||||||
// next item is at a higher level
|
// next item is at a higher level
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue