Skip to content

Commit

Permalink
[para-api] Try rearranging debug-assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
jfkthame committed Dec 6, 2023
1 parent 5d785ce commit 41057ca
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,13 @@ fn compute_initial_info<'a, D: BidiDataSource, T: TextSource<'a> + ?Sized>(
// The stack contains the starting code unit index for each nested isolate we're inside.
let mut isolate_stack = Vec::new();

#[cfg(debug_assertions)]
if let Some((ref paragraphs, ref pure_ltr)) = split_paragraphs {
debug_assert!(paragraphs.is_empty());
debug_assert!(pure_ltr.is_empty());
}
debug_assert!(
if let Some((ref paragraphs, ref pure_ltr)) = split_paragraphs {
paragraphs.is_empty() && pure_ltr.is_empty()
} else {
true
}
);

let mut para_start = 0;
let mut para_level = default_para_level;
Expand Down

0 comments on commit 41057ca

Please sign in to comment.