Skip to content

Commit 0ccf953

Browse files
committed
refactor: get cells by reference instead of cloning them
1 parent a2fda8b commit 0ccf953

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/backend/dom.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl Backend for DomBackend {
213213

214214
for (x, y, cell) in content {
215215
let cell_position = (y * self.size.width + x) as usize;
216-
let elem = self.cells[cell_position].clone();
216+
let elem = &self.cells[cell_position];
217217

218218
elem.set_inner_html(cell.symbol());
219219
elem.set_attribute("style", &get_cell_style_as_css(cell))
@@ -222,7 +222,7 @@ impl Backend for DomBackend {
222222
// don't display the next cell if a fullwidth glyph preceeds it
223223
if cell.symbol().len() > 1 && cell.symbol().width() == 2 {
224224
if (cell_position + 1) < self.cells.len() {
225-
let next_elem = self.cells[cell_position + 1].clone();
225+
let next_elem = &self.cells[cell_position + 1];
226226
next_elem.set_inner_html("");
227227
next_elem
228228
.set_attribute("style", &get_cell_style_as_css(&Cell::new("")))

0 commit comments

Comments
 (0)