Skip to content

Commit 6e85020

Browse files
committed
A bit cleanup of NEXT_NAMESPACE_ID
1 parent 43e8d85 commit 6e85020

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

webrender/src/render_backend.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use serde::{Serialize, Deserialize};
4242
use serde_json;
4343
#[cfg(any(feature = "capture", feature = "replay"))]
4444
use std::path::PathBuf;
45-
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
45+
use std::sync::atomic::{AtomicUsize, Ordering};
4646
use std::mem::replace;
4747
use std::os::raw::c_void;
4848
use std::sync::mpsc::{channel, Sender, Receiver};
@@ -360,7 +360,8 @@ impl DocumentOps {
360360
}
361361

362362
/// The unique id for WR resource identification.
363-
static NEXT_NAMESPACE_ID: AtomicUsize = ATOMIC_USIZE_INIT;
363+
/// The namespace_id should start from 1.
364+
static NEXT_NAMESPACE_ID: AtomicUsize = AtomicUsize::new(1);
364365

365366
#[cfg(any(feature = "capture", feature = "replay"))]
366367
#[cfg_attr(feature = "capture", derive(Serialize))]
@@ -419,9 +420,6 @@ impl RenderBackend {
419420
sampler: Option<Box<AsyncPropertySampler + Send>>,
420421
size_of_op: Option<VoidPtrToSizeFn>,
421422
) -> RenderBackend {
422-
// The namespace_id should start from 1.
423-
NEXT_NAMESPACE_ID.fetch_add(1, Ordering::Relaxed);
424-
425423
RenderBackend {
426424
api_rx,
427425
payload_rx,

0 commit comments

Comments
 (0)