Use swap() instead of load()/store() in get_and_reset_text_shaping_performance_counter()

Signed-off-by: Mattias de los Rios Rogers <delosrogers@gmail.com>
This commit is contained in:
delosrogers 2021-03-07 13:48:32 -08:00
parent 3a8cb5b37d
commit b1d72f65ee

View file

@ -522,8 +522,7 @@ impl RunMetrics {
}
pub fn get_and_reset_text_shaping_performance_counter() -> usize {
let value = TEXT_SHAPING_PERFORMANCE_COUNTER.load(Ordering::SeqCst);
TEXT_SHAPING_PERFORMANCE_COUNTER.store(0, Ordering::SeqCst);
let value = TEXT_SHAPING_PERFORMANCE_COUNTER.swap(0,Ordering::SeqCst);
value
}