Skip to content

Commit 73659eb

Browse files
committed
Replace push_back with emplace_back in simulator_radar.pyx
Updated vector insertion methods from push_back to emplace_back for target and point objects in sim_radar. This change may improve performance and clarity by constructing objects in place.
1 parent a1ad94f commit 73659eb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/radarsimcpp

src/radarsimpy/simulator_radar.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ cpdef sim_radar(radar, targets, frame_time=None, density=1, level=None, interf=N
329329
if "model" in tgt:
330330
if mesh_module is None:
331331
mesh_module = import_mesh_module()
332-
target_vt.push_back(cp_Target(radar, tgt, timestamp, mesh_module))
332+
target_vt.emplace_back(cp_Target(radar, tgt, timestamp, mesh_module))
333333
else:
334334
# Extract point target parameters with defaults
335335
loc = tgt["location"]
336336
spd = tgt.get("speed", (0, 0, 0))
337337
rcs = tgt["rcs"]
338338
phs = tgt.get("phase", 0)
339339

340-
point_vt.push_back(
340+
point_vt.emplace_back(
341341
cp_Point(loc, spd, rcs, phs, ts_shape)
342342
)
343343

0 commit comments

Comments
 (0)