Skip to content

Commit

Permalink
Use SmallVec for local stack in isolating_run_sequences().
Browse files Browse the repository at this point in the history
  • Loading branch information
jfkthame committed Feb 27, 2024
1 parent d3df915 commit ac6370b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use alloc::vec::Vec;
use core::cmp::max;
use core::ops::Range;
#[cfg(feature = "smallvec")]
use smallvec::{SmallVec, smallvec};

use super::level::Level;
use super::BidiClass::{self, *};
Expand Down Expand Up @@ -52,6 +54,9 @@ pub fn isolating_run_sequences(

// When we encounter an isolate initiator, we push the current sequence onto the
// stack so we can resume it after the matching PDI.
#[cfg(feature = "smallvec")]
let mut stack: SmallVec::<[Vec<Range<usize>>; 8]> = smallvec![vec![]];
#[cfg(not(feature = "smallvec"))]
let mut stack = vec![vec![]];

for run in runs {
Expand Down

0 comments on commit ac6370b

Please sign in to comment.